Date: Sat, 05 May 2001 09:40:58 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: jeffw AT darwin DOT sfbr DOT org Message-Id: <1438-Sat05May2001094057+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: <20010504160823.A19921@kendall.sfbr.org> (message from JT Williams on Fri, 4 May 2001 16:08:23 -0500) Subject: Re: __DJGPP__ and MSDOS References: <20010430093758 DOT A5379 AT kendall DOT sfbr DOT org> <20010504160823 DOT A19921 AT kendall DOT sfbr DOT org> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Fri, 4 May 2001 16:08:23 -0500 > From: JT Williams > > % gcc -c hello.c > In file included from hello.c:1: > hello.h:6: warning: #warning Found msdos. <-- does *not* see __DJGPP__ > % gcc -o hello.exe hello.o > % ./hello.exe > hello, world > hello, djgpp <-- but hello.c *does* see __DJGPP__ > hello, dos > > 2. Compile `hello.c' with headers in this order: > #include > #include "hello.h" > > % gcc -c hello.c > In file included from hello.c:2: > hello.h:2: warning: #warning Found djgpp. <-- > hello.h:6: warning: #warning Found msdos. > % gcc -o hello.exe hello.o > % ./hello.exe > hello, world > hello, djgpp <-- > hello, dos > > So, depending on header #include order, __DJGPP__ may not be defined > and available for #ifdef testing inside `hello.h'. I suspect that you don't have a specs file, or use specs from a later GCC distribution. GCC 2.7.x needs lib/specs to define the symbol __DJGPP__ (and also __DJGPP_MINOR__) to the right values. Compile with -v, and GCC will tell you where does it take specs, and what other hidden arguments does it pass to cpp and cc1.