Welcome, Guest. Please login or register.

Author Topic: Which includes to use for C compilers  (Read 4112 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline asrael22Topic starter

  • Jr. Member
  • **
  • Join Date: Mar 2017
  • Posts: 77
    • Show only replies by asrael22
Which includes to use for C compilers
« 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
 

Offline krashan

  • Sr. Member
  • ****
  • Join Date: Jan 2003
  • Posts: 253
  • Country: pl
  • Thanked: 1 times
  • Gender: Male
  • Hardware designer and programmer
    • Show only replies by krashan
    • Personal homepage
Re: Which includes to use for C compilers
« Reply #1 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.

Offline asrael22Topic starter

  • Jr. Member
  • **
  • Join Date: Mar 2017
  • Posts: 77
    • Show only replies by asrael22
Re: Which includes to use for C compilers
« Reply #2 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?
 

Offline asrael22Topic starter

  • Jr. Member
  • **
  • Join Date: Mar 2017
  • Posts: 77
    • Show only replies by asrael22
Re: Which includes to use for C compilers
« Reply #3 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.
 

Offline krashan

  • Sr. Member
  • ****
  • Join Date: Jan 2003
  • Posts: 253
  • Country: pl
  • Thanked: 1 times
  • Gender: Male
  • Hardware designer and programmer
    • Show only replies by krashan
    • Personal homepage
Re: Which includes to use for C compilers
« Reply #4 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.