Date: Fri, 01 Jun 2001 20:25:39 -0500 From: "G. Adam Stanislav" <adam@whizkidtech.net> To: Farooq Mela <fmela0@sm.socccd.cc.ca.us>, freebsd-hackers@FreeBSD.ORG Subject: Re: _ANSI_SOURCE vs. _ANSI_C_SOURCE Message-ID: <3.0.6.32.20010601202539.00f7fab0@mail85.pair.com> In-Reply-To: <3B170531.47E6724F@sm.socccd.cc.ca.us>
next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.6.32.20010601202539.00f7fab0>