VBCC & AmigaOS 3.2 NDK?
I am trying to update my VBCC config to use the 3.2 NDK.
I'm getting compile-time errors though: ----- Quote:
I decided to mimic the 3.9 NDK setup, so with a little folder renaming, I have: /ndk32/Include/ fd/ include_h/ include_i/ linker_libs/ sfd/ (just FYI, got same errors before I reorganized). I use same config file I had before, but replaced "ndk39" with "ndk32". eg: -cc=vbccm68k -c99 -quiet -hunkdebug %s -o= %s %s -O=%ld -I"$VBCC/targets/m68k-amigaos/include" -I"$VBCC/ndk32/Include/include_h" -I"$VBCC/p96/Include" From the News section thread, it looks like someone has got this working, but also that maybe it doesn't work out of the box. Can "someone" explain how to get it working? |
Did you download FD2Pragma and use the correct conversion from the FD files?
|
No, I was confused about the necessity of that.
I have it compiling again now (thanks!), albeit with a couple warnings that it didn't used to have about GetAttr pointer types not agreeing. It's not obvious to me what changed there, but it seems to run ok at the moment, so I'll track that down later. For anyone doing it, this is what I had to do to get it working on my (non-Amiga VBCC install): 1. Download fd2pragma 2. modify the VBCC make protos script that comes with fd2pragma, to know about 3.2 things, and to use .sfd instead of .fd. See my version attached. You may be able to tweak a couple paths to get it to work for you. 3. set up a new blank "proto" and "inline" folder directories where sf2pragma could get to them. 4. run script 5. rename the old "proto" and "inline" folders in $VBCC/targets/m68k-amigaos/include 6. drop the new "proto" and "inline" folders into that dir. I didn't mess with $VBCC/targets/m68k-amigaos/lib FWIW, I got a warning on conversion for virtual_lib.sfd and mathieeedoubletrans_lib.sfd Code:
set proto Applications:dev/vbcc/proto |
A documentation for using VBCC with the 3.2 NDK is currently being prepared. Thank you for sharing your experiences.
|
There is only one typedef missing from exec/types.h:
Code:
typedef unsigned long AVLKey; |
I have prepared a new m68k-amigaos target archive, based on NDK 3.2, some days ago. My approach was to keep the NDK 3.9 fd files during the fd2pragma-run, but those files which are present in both NDKs are overwritten by 3.2. So the AVL functions from exec are gone, for example.
The official release will take a few days, because my A3000/060 no longer works reliably, since more than a year. If anybody wants to help testing, please email me. |
Quote:
|
I did again with your new version (but on Mac this time, not on Amiga)
I noticed that when I did it this morning, with a clear mind, I had been parsing some random set of SFD files that I can't account for. Was like 90 files. NDK32r2 only has 44 SFD files. Here is latest script, now for unix. Code:
#!/bin/zsh Code:
SourceFile: /opt/vbcc/_ndk32/SFD/layers_lib.sfd struct Layer *CreateUpfrontLayer(struct Layer_Info *li, struct BitMap *bm, LONG x0, LONG y0, LONG x1, LONG y1, LONG flags, [struct BitMap *bm2] )(A0,A1,D0,D1,D2,D3,D4,A2) struct Layer *CreateBehindLayer(struct Layer_Info *li, struct BitMap *bm, LONG x0, LONG y0, LONG x1, LONG y1, LONG flags, [struct BitMap *bm2] )(A0,A1,D0,D1,D2,D3,D4,A2) Code:
SourceFile: /opt/vbcc/_ndk32/SFD/intuition_lib.sfd Code:
SourceFile: /opt/vbcc/_ndk32/SFD/exec_lib.sfd Code:
> GetAttr (IA_Width, win_resize_image, &win_resize_gadget_width); |
Quote:
Anyway, there is no support for [type name]in fd2pragma as far as I can see. And this is a problem, as the bracketed arguments are missing in the inlines. You can always manually remove them from the SFD, of course... ;) Quote:
Here is a quick hack, which makes it work, but it needs some testing: Code:
--- fd2pragma.c 6 Jun 2021 13:53:01 -0000 1.12 Quote:
Quote:
|
Quote:
It "smells" like something is just wrong in my 3.2 setup for VBCC, and the symptom is this warning about pointer types. I tried just casting them to their expected types, which usually is enough to shut the compiler up, but get exactly the same message. Here's the whole bit of code up to the warning: Code:
// creates the gadgets needed for the window, returns pointer to the first gadget For the layers_lib.sfd problem, I'll try using the .fd files to make that one. Might be a decent workaround until we know what those brackets are supposed to be doing. |
Good news (from my point of view): if I use .fd + clib, I can get it building my app in such a way that it runs normally. (Still getting those warnings, but assuming that's unrelated really).
Tweaked script if anyone needs something before a pre-baked solution is available: Code:
#!/bin/zsh |
Quote:
But going the FD-route is certainly an option. I am always building the official m68k-amigaos target archives using FD files and clib files only. I should really switch to SFD, which theoretically makes it easier, but I was scared to run into problems, like you did. |
Quote:
Quote:
unsigned long*doesn't help much, when GetAttr() needs an ULONG*. I found out that the exec/types.h header from NDK 3.2 uses C99 stdint.h to define the AmigaOS types like ULONG. In the past it was simply defined as unsigned long. Now ULONG is defined as: Code:
typedef uint32_t ULONG; /* unsigned 32-bit quantity */ Code:
typedef unsigned int uint32_t; |
even after 25 years you can't expect a standard like 'sys/types.h' to be used or supported...
|
2 Attachment(s)
Quote:
|
Quote:
the sfd file does not generate Code:
struct Layer * __CreateUpfrontLayer(__reg("a6") struct Library *, __reg("a0") struct Layer_Info * li, __reg("a1") struct BitMap * bm, __reg("d0") LONG x0, __reg("d1") LONG y0, __reg("d2") LONG x1, __reg("d3") LONG y1, __reg("d4") LONG flags, __reg("a2") struct BitMap * bm2)="\tjsr\t-36(a6)"; => all further offsets are incorrect |
Quote:
Thanks for that. I prefer to use "unambiguous" data types when I can, but even when I'm being my best about that (which honestly, for non-work: not so often), unambiguous is a pretty risky word for C. Ah, well. Somewhere on my to-do list for this project is "check all data type declarations and make consistent". I should probably just surrender and use all native Amiga ULONGs and whatnot. |
Quote:
[struct BitMap *bm2]and ignores the line, which is fatal for the offset count. Olaf Barthel just told me that the layers_lib.sfd was fixed for the next release, so anybody may remove these brackets locally. |
Quote:
sys/types.his not part of any ISO-C standard. This is POSIX. For standard types we have stdint.hsince ISO-C99. |
Quote:
thank you for that update (my stdint.h includes sys/types.h). But stdint.h is also not referenced by the NDK... |
All times are GMT +2. The time now is 01:07. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.