octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MINGW build


From: John W. Eaton
Subject: Re: MINGW build
Date: Thu, 10 Oct 2002 01:19:26 -0500

On 23-Sep-2002, Mumit Khan <address@hidden> wrote:

| I do have a comment on using the pre-processor macro/s to determine
| the system or system type. If you want a Windows 32 bit system, then
| it's __WIN32__ and/or __WIN32 (the non-underscored counterparts are
| an abomination); if you want to exclude Cygwin, then it's __WIN32__ &&
| !__CYGWIN__. Mingw is plain Windows32, and thus covered by __WIN32__,
| and there is typically never a good reason to use __MINGW32__ explicitly,
| unless you're taking advantage of something specific in Mingw helper
| libraries.

Hmm.

Neither of the cygwin compilers that I have seem to define __WIN32__
or __WIN32:

$ i386-pc-cygwin-gcc -v foo.c
Reading specs from /usr/local/cross/lib/gcc-lib/i386-pc-cygwin/3.2/specs
Configured with: /home/jwe/build/cross/gcc-3.2/configure 
--enable-languages=c,c++,f77 --with-included-gettext --target=i386-pc-cygwin 
--enable-shared --prefix=/usr/local/cross --with-newlib
Thread model: single
gcc version 3.2
 /usr/local/cross/lib/gcc-lib/i386-pc-cygwin/3.2/cc1 -lang-c -v -D__GNUC__=3 
-D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -D_X86_=1 
-D_X86_=1 -Asystem=winnt -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 
-Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i386__ 
-D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) 
-D_stdcall=__attribute__((__stdcall__)) -D_cdecl=__attribute__((__cdecl__)) 
-D__declspec(x)=__attribute__((x)) -D__i386__ -D__i386 -D__CYGWIN32__ 
-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter 
/usr/local/cross/i386-pc-cygwin/include -idirafter 
/usr/local/cross/i386-pc-cygwin/include/w32api foo.c -quiet -dumpbase foo.c 
-version -o /tmp/ccYGcfCw.s

$ gcc foo.c
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
gcc version 2.95.3-5 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/cpp0.exe -lang-c -v -D__GNUC__=2 
-D__GNUC_MINOR__=95 -D_X86_=1 -D_X86_=1 -Asystem(winnt) -Acpu(i386) 
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 
-D__i686__ -D__pentiumpro -D__pentiumpro__ 
-D__stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) 
-D_stdcall=__attribute__((__stdcall__)) -D_cdecl=__attribute__((__cdecl__)) 
-D__declspec(x)=__attribute__((x)) -D__CYGWIN32__ -D__CYGWIN__ -Dunix 
-D__unix__ -D__unix -isystem /usr/local/include -idirafter /usr/include 
-idirafter /usr/include/w32api foo.c 
/cygdrive/c/DOCUME~1/JWE~1.SEG/LOCALS~1/Temp/ccjMe2yf.i

So it seems that we need to check __WIN32__ and __CYGWIN__.  Or am I
missing something?

Thanks,

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]