This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: I: gcc ... -U_WIN32 ... may cause problems
- To: Craig Nelson <craig at reversion dot ca>
- Subject: Re: I: gcc ... -U_WIN32 ... may cause problems
- From: Geoffrey Noer <noer at cygnus dot com>
- Date: Mon, 31 Aug 1998 15:53:03 -0700
- Cc: gnu-win32 at cygnus dot com
- References: <199808300406.WAA01030@tuffy.reversion.ca>
On Sat, Aug 29, 1998 at 10:06:06PM -0600, Craig Nelson wrote:
[...]
> What purpose does defining _WIN32 serve in a CYGWIN32 environment? Isn't
> CYGWIN32 supposed to make our UNIX code think it's still on a UNIX box?
>
> I have libraries that can be compiled with MSV++ or on UNIX, and I like
> the option of being able to use either environment for use on windows (via
> CYGWIN32) but I have to #ifdef code to do that. IMHO, it would be
> nice to get rid of the _WIN32 definition here if its not really needed.
>
> What's the Cygnus position on this?
Hmmmm...
The scheme we've been using here is to use:
_WIN32 to indicate availability of the Win32 API.
_MSC_VER to indicate MSVC-specific code.
__CYGWIN32__ to indicate cygwin-specific code.
As I've mentioned before, we will be moving to a single gcc
configuration that generates either Mingw *or* Cygwin32-linked code, a
configuration called "i586-win32" (which can itself be either Mingw or
Cygwin32-based). The preliminary/not-well-tested version of this will
be included as part of the upcoming EGCS 1.1 release.
Looking at its specs file (see gcc/config/i386/win32.h once EGCS 1.1
is released), -mcygwin as a compile-time flag defines __CYGWIN32__,
otherwise __MINGW32__ is defined. Either way _WIN32 is defined.
Perhaps -Dunix should be added to the define list whenever
__CYGWIN32__ is defined? Linux includes -Dunix and -Asystem(posix) in
CPP_PREDEFINES (looking at gcc/config/i386/linux.h).
--
Geoffrey Noer
noer@cygnus.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".