27 February 2022, 16:06 | #1 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,443
|
VBCC & AmigaOS 3.1 NDK?
Hi all!
I'm mimicking this other thread about AmigaOS 3.2 because I think that I've got the same problem but in the other "direction"... and also because it proposes a solution that I don't know how to apply So, I was happily compiling with the VBCC and the NDK 3.9 when I wanted to compile against the NDK 3.1 (yes, 3.1). Naively, I thought that I could "just" point to the includes in the NDK 3.1 but that leads to too many warnings. Here is an example: Code:
>LONG __Write(__reg("a6") void *, __reg("d1") BPTR file, __reg("d2") CONST APTR warning 57 in line 17 of "inline/dos_protos.h": , expected included from file "vincludeos3:proto/dos.h":22 included from file "blacklists.c":46 Cheers! PS. Command lines:
|
27 February 2022, 17:58 | #2 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
These dos.library inlines were generated with NDK3.9 clib headers, which declares the second argument of Write() as
CONST APTR. Problem is that NDK3.1 doesn't know about CONST. It was introduced with NDK3.9. You may work around it by adding a Code:
#define CONST const EDIT: Or better "#define CONST" (without const), to match the 3.1 prototypes. Last edited by phx; 27 February 2022 at 17:59. Reason: #define CONST |
27 February 2022, 19:28 | #3 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,443
|
Hi PHX and thanks for your help always
I'm going to try to generate the NDK 3.1-compliant protos and inlines using fd2pragma like you explained me for RoadShow and also here, thanks a lot Cheers! PS. Could you explain me why these protos and inlines are necessary and how they are used by the compiler? |
27 February 2022, 19:45 | #4 |
Registered User
Join Date: Jan 2005
Location: Umeå
Age: 44
Posts: 939
|
Is there a specific need to use the 3.1 NDK? A more recent NDK just gives you the possibility to use functions/libraries added after 3.1, but you still choose which functions/libraries you use yourself.
|
27 February 2022, 20:07 | #5 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,443
|
Hi Patrick!
Yes, that's exactly the reason why I'd like to compile for "strictly" 3.1: I'm not too clear (my bad!) on which functions/libraries are in 3.1, only 3.9, and now only 3.2 So I'd like to compile for 3.1 and add what I need as I need them, like MUI, RoadShow, XAD and now ClassAct... Cheers! |
27 February 2022, 20:57 | #6 |
Coder/webmaster/gamer
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,687
|
Best to use a more recent NDK. Anything new will be clearly marked as "(V45)", etc.
|
27 February 2022, 22:14 | #7 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
Quote:
<proto/xyz.h>you make sure that your compiler uses the most efficient way to call library functions (inlines for vbcc and gcc, pragmas for SAS/C, Aztec-C, DiceC). An alternative, which always works, is to include <clib/xyz_protos.h>instead. Then you will have to link a stub routine from amiga.lib to call a library function. But you have less problems with modified argument types between NDK releases. |
|
27 February 2022, 23:23 | #8 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,443
|
Thanks a lot PHX
Also, I managed the generate the inlines and recompile successfully AmiModRadio with them! |
08 March 2022, 23:44 | #9 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 148
|
Hey this is tangential to your problem but NDK3.2R4 (available today on the Hyperion website) includes a great explainer about all the proto/pragma/inline stuff and why it’s all so compiler specific.
|
09 March 2022, 00:03 | #10 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,443
|
Hi Alancfrancis!
Thanks a lot! I just downloaded it and will read "InterfaceHeaderFiles", by Olaf Barthel!, later Cheers! Last edited by tygre; 07 April 2022 at 04:22. Reason: Missing s |
09 March 2022, 00:18 | #11 |
Registered User
Join Date: Jun 2020
Location: Scotland
Posts: 148
|
@tygre I really enjoyed it. Explained so much that I hadn’t really understood before.
|
09 March 2022, 02:41 | #12 | |
Registered User
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 414
|
Quote:
I ran into that preprocessor-token-in-tagcall issue with GCC + MUI. Stumbled upon the NO_INLINE_STDARG solution but didn't know why it worked until now. |
|
13 March 2022, 00:27 | #13 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,443
|
Hi Alancfrancis and all!
Very very interesting indeed, thanks And all this to have parameter values in CPU registers rather than on the stack! Now, am I right to think that I should avoid including anything in clib, pragmas, pragma, and inline and, rather, include only things in proto? Especially with the NDK 3.2 R3 that supports VBCC now But then, I wonder what to do about clib/alib_protos.h then? There doesn't see to exist any include file in proto that declare, for example, CreatePort, NewList... Cheers! Last edited by tygre; 13 March 2022 at 06:35. |
13 March 2022, 14:08 | #14 | ||
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,553
|
Quote:
Quote:
proto/alib.h. But for compatibility with older NDKs you may want to stick to clib/alib_protos.h. |
||
13 March 2022, 15:43 | #15 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,443
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AmigaOS 3.2 NDK released | bubbob42 | News | 16 | 14 May 2024 18:17 |
VBCC & AmigaOS 3.2 NDK? | Warty | Coders. C/C++ | 20 | 18 June 2021 08:41 |
AmigaOS & lha | Ulysses13 | New to Emulation or Amiga scene | 4 | 04 June 2021 20:58 |
VBCC/NDK/Make AmiTCP dependency? | Sim085 | support.Apps | 2 | 22 February 2020 22:32 |
VBCC & guru meditation | majikeyric | Coders. C/C++ | 11 | 10 October 2018 08:37 |
|
|