bug-gnulib
[Top][All Lists]
Advanced

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

predefined preprocessor macros on Windows platforms


From: Bruno Haible
Subject: predefined preprocessor macros on Windows platforms
Date: Fri, 16 Feb 2007 00:45:33 +0100
User-agent: KMail/1.5.4

Hi,

This is the yearly FAQ posting about the symbols defined on C/C++ compilations
on Windows.

1) The compiler indicators:
  - Mingw, Cygwin:  __GNUC__
  - MSVC:           _MSC_VER
  - Borland:        __TURBOC__, __BORLANDC__

2) The CPU indicators for x86:
  - Mingw, Cygwin:  _X86_, __i386__
  - MSVC, Borland:  _M_IX86
The CPU indicators for x86_64:
  - Mingw, Cygwin:  __x86_64__
  - MSVC:           _M_X64

3) Operating system:
  - Cygwin default: __CYGWIN32__
  - Cygwin when the installer wants to use native Woe32 API (option -mwin32):
                    __CYGWIN32__, _WIN32
  - Mingw:          _WIN32
  - MSVC:           _WIN32
  - Borland:        __WIN32__

So, to test whether native Woe32 API is available, use

  defined _WIN32 || defined __WIN32__

And to test whether native Woe32 API should be used when there is also an
equivalent POSIX API, use

  (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN32__


Bruno

References:
[1] http//predef.sourceforge.net/
[2] GNU clisp's lispbibl.d





reply via email to

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