bug-gnulib
[Top][All Lists]
Advanced

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

Re: Woe32 conditionals (was: getpass: use of termios.h problematic)


From: Bruno Haible
Subject: Re: Woe32 conditionals (was: getpass: use of termios.h problematic)
Date: Fri, 26 Aug 2005 14:27:29 +0200
User-agent: KMail/1.5

Simon Josefsson wrote:
> +#if !defined WIN32

This conditionalization treats Woe32 with the mingw compiler differently
that Woe32 with the MSVC compiler (although both have mostly the same
APIs). This is most likely wrong.

Here's the matrix of the predefined macros on Woe32:

                       msvcrt/MSVC    mingw/GCC      Cygwin/GCC    Cygwin/GCC
                                                                     -mwin32

WIN32                                     X                             X

_WIN32                       X            X                             X

__CYGWIN__                                                X             X

__MINGW32__                               X

__WIN32, __WIN32__                        X

__unix, __unix                                            X             X


Conclusion:
- To test for a Woe32 platform without Unix API, you need
     #ifdef _WIN32
- To test for the POSIX implementation called Cygwin, you need
     #ifdef __CYGWIN__
- Rarely use #ifdef WIN32 or #ifdef __MINGW32__.

Bruno





reply via email to

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