View Single Post
Old 23 June 2021, 13:36   #10
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,546
Quote:
Originally Posted by guy lateur View Post
This does make me wonder how the order works for include paths. For instance, if I
#include <proto/texteditor.h>
. This file can be found via
vincludeos3:
(in cc setting in
vc.config
) as well as via
NDK32:Include_H
(passed to vc via the -I switch; see my makefile). So which file gets included in this case?
When you look into your config file you see a line on top for calling the compiler, which looks like this:
Code:
-cc=vbccm68k -quiet -hunkdebug %s -o= %s %s -O=%ld -Ivincludeos3:
The first %s is the source file, the second the target file and the third contains any compiler options you pass, like
-I
. So paths, which you specify on the command line, do always have priority. Which is a problem here, because the
proto
directory from the NDK 3.2 has no vbcc support and must not replace vbcc's protos.

Under AmigaOS you should add the NDK path to the
vincludeos3:
assignment, so it is searched after
targets/m68k-amigaos/include
. On other host systems just add a second
-I
at the end of the
-cc
and
-ccv
lines in the config file.

Quote:
I suppose I should always try to have the vbcc includes take priority over the NDK ones, right?
True.

Quote:
Code:
ULONG __saveds highlightBlock(__reg("a0") struct Hook *hook, __reg("a2") VOID *obj, __reg("a1") VOID *msg)
{
    return FormatTest2(hook, obj, msg);
}
This is correct, right?
Looking good.

Quote:
So, after all this, I'm still having the error
The error about
HighlightSetFormat
being undefined? This has three reasons:
  1. NDK3.2 support is still missing in vbcc. So you have to take the texteditor_lib.sfd (which is not even included in the last NDK release) and generate proto, inline and amiga.lib stub routines from it.
  2. vbcc support is missing in NDK3.2. So including the NDK3.2 proto headers doesn't give you any inline calls for the library.
  3. The last released NDK3.2 amiga.lib does neither have stub functions for all libraries, nor does it have all FD or SFD files.
    HighlightSetFormat()
    is a V47 function and is definitely missing. So it also doesn't help you to link against the NDK's amiga.lib.
Quote:
Or is there anything else I could easily try to get this linking properly?
Here is a first test version of the updated m68k-amigaos target:
http://sun.hasenbraten.de/~frank/TES...8k-amigaos.lha

You may try to replace all your files in
targets/m68k-amigaos
with the upated ones. But no guarantee! I didn't have enough time for testing. Do backups!

Quote:
For your inspiration, here's my current m68k.c file. As mentioned earlier, I included all kinds of header files I thought might be relevant, including the inline one.
Usually neither including
clib
,
inline
nor
pragmas
should be needed as
proto
should take care of that. Also pragmas are for SAS/C and will be ignored for vbcc. The inline header file exists in the old vbcc distribution, but is lacking
HighlightSetFormat()
as a new V47 function.

Quote:
I also have no idea what those defines near the top mean, btw, so if anybody wants to enlighten me..
__NOLIBBASE__
makes sure that the proto headers do not declare their library base as externally defined. You will have to do it yourself then.

I don't think that
__CLIB_PRAGMA_LIBCALL
has any function. I don't see it in any NDK 3.2 header file. If it exists, it is probably SAS/C-specific.
phx is offline  
 
Page generated in 0.04677 seconds with 10 queries