From owner-freebsd-hackers Fri Jun 1 18:26:10 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.bfm.org (mail.bfm.org [216.127.218.26]) by hub.freebsd.org (Postfix) with ESMTP id 1CC1837B422 for ; Fri, 1 Jun 2001 18:26:01 -0700 (PDT) (envelope-from adam@whizkidtech.net) Received: from WhizKid (rh5.bfm.org [216.127.220.198]) by mail.bfm.org (Post.Office MTA v3.5.3 release 223 ID# 0-52399U2500L250S0V35) with SMTP id org; Fri, 1 Jun 2001 20:30:20 -0500 Message-Id: <3.0.6.32.20010601202539.00f7fab0@mail85.pair.com> X-Sender: whizkid@mail85.pair.com X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Fri, 01 Jun 2001 20:25:39 -0500 To: Farooq Mela , freebsd-hackers@FreeBSD.ORG From: "G. Adam Stanislav" Subject: Re: _ANSI_SOURCE vs. _ANSI_C_SOURCE In-Reply-To: <3B170531.47E6724F@sm.socccd.cc.ca.us> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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