Amiga.org

Amiga computer related discussion => Amiga/MorphOS/AROS Programmers Forum => Topic started by: asrael22 on June 20, 2024, 08:23:57 PM

Title: Which includes to use for C compilers
Post by: asrael22 on June 20, 2024, 08:23:57 PM
Hi.

Most C compilers (vbcc, sas/c, etc). come with their own set of Amiga includes.
But there is also the AOS NDK includes.
How should this be used? Does one should have precedence over the other?

I have been setting this up as assigns where the NDK includes/libs are first and then the compiler specific includes ADDed to the assign.
Is this the right way?


Cheers
Title: Re: Which includes to use for C compilers
Post by: krashan on June 21, 2024, 06:58:51 AM
Not sure about SAS/C, but VBCC does not come with includes replacing the NDK. Same for GCC. Usually compiler provides headers for C standard library and interface to AmigaOS API (it may be set of files in 'inline' or 'pragma' directory, someties with a static library). Definitions of AmigaOS structures come from the NDK. The NDK itself contains inline files too, which try to be universal. I prefer to replace NDK inlines with compiler provided ones, then place NDK includes in the include search path of the compiler.
Title: Re: Which includes to use for C compilers
Post by: asrael22 on June 21, 2024, 02:02:28 PM
Alright, thanks.

When you say "I prefer to replace NDK inlines with compiler provided ones", what do you mean with 'replace' here, how do you replace them?
Title: Re: Which includes to use for C compilers
Post by: asrael22 on June 21, 2024, 02:43:40 PM
I've checked, SAS/C actually comes with a full set of Amiga headers, probably 3.1 based.
VBCC does not.
Title: Re: Which includes to use for C compilers
Post by: krashan on June 25, 2024, 03:42:23 PM
Quote
what do you mean with 'replace' here, how do you replace them?
I replace them literally. Delete original ones and copy my files there.
Inline files in the NDK 3.2 are quite good and work with most of C compilers. However they are incompatible with GCC 2.95.3 compiler used in C++ mode. This was my reason to replace them.