At 20:00 31-05-2001 -0700, Farooq Mela wrote:
>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).
My copy of POSIX Programmer's Guide says, in Chapter 9:
"The chances of stumbling over a reserved C or POSIX name can be
minimized by following a few simple rules:
1. Start each source file with the line:
#define _POSIX_SOURCE 1
All symbols not defined by Standard C or the POSIX standard
will be hidden, except those with leading underscores.
2. Following the definition of _POSIX_SOURCE, place the #include
statements for any standard header files."
There's more, but that should answer one of your questions. :)
I don't know about the _POSIX_C_SOURCE though. I suppose you
could always define:
#define _POSIX_SOURCE 1
#define _POSIX_C_SOURCE _POSIX_SOURCE
Cheers,
Adam
---
http://phonecowboy.com/registrar/twist/ finds a good domain for you
and checks for its existence.
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message