Mail Archives: djgpp/2001/05/05/02:40:13
> Date: Fri, 4 May 2001 16:08:23 -0500
> From: JT Williams <jeffw AT darwin DOT sfbr DOT org>
>
> % 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 <stdio.h>
> #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.
- Raw text -