Farooq Mela <[EMAIL PROTECTED]> writes:

> I am wondering why some operating systems use the macro _ANSI_SOURCE
> while others (ie Linux) use _ANSI_C_SOURCE to indicate that the source
> compiled is ANSI-compliant (and similarly with _POSIX_SOURCE and
> _POSIX_C_SOURCE). I have neither copies of the ANSI nor POSIX spec,

here is explained the difference between _POSIX_SOURCE and
_POSIX_C_SOURCE :

http://www.freebsd.org/cgi/man.cgi?query=standards&apropos=0&sektion=0&manpath=SunOS+5.8&format=html

in short :

_POSIX_C_SOURCE is an extention of _POSIX_SOURCE.  the later only
refer to the original standard and the former to subsequent standards.

more informations may be found in stdsyms(5) on http://docs.hp.com but
none of them refer to any _ANSI_SOURCE or whatever. as far as I know,
the only symbol defined by the ANSI standard is __STDC__ which should
be tested like this to be safe :

#if (__STDC__ - 0) != 0
ansi compiler
#else
k&r compiler
#endif

> and I don't see any mention of either of these in APUE. So I'm
> guessing these are sort of de-facto macros that are being used. Can
> somebody shed some light on why these are different, and why some have
> the _C in the middle?

Cyrille.
--
home: mailto:[EMAIL PROTECTED]   UNIX is user-friendly; it's just particular
work: mailto:[EMAIL PROTECTED]   about who it chooses to be friends with.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to