Boost logo

Boost :

From: Ferdinand Prantl (ferdinand.prantl_at_[hidden])
Date: 2004-07-16 06:44:16


Hi Volodya,

> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Vladimir Prus
>

[snip]

> Does it mean I have to use the same conditional? Which
> compilers define __WIN32__ or WIN32, but don't define _WIN32?
> Shouldn't there be a single BOOST_WINDOWS macros to help in
> this cases?

The macro _WIN32 was originally hard-coded into the Microsoft compiler
to recognize the platform. The other vendors took it the same way, but
maybe because of rapid development in the early ages there are more
underscored versions available... Here we are macros *32*, as they are
defined:

Borland: __WIN32__ _WIN32
Digital Mars: _WIN32
GCC (MinG/W and Cygwin with -mno-cygwin): __MINGW32__ WIN32 _WIN32 __WIN32
__WIN32__
Metrowerks: _WIN32
Microsoft: _WIN32

The macro WIN32 is meant to be a user-definable option how to enforce
a WIN32 code if a compiler does not define _WIN32.

Cygwin platform in POSIX mode is not a WIN32-compatible platform (no
headers,
no libraries), and thus their macros should mark a POSIX code, not Windows:

GCC (Cygwin in POSIX mode): __CYGWIN__ __CYGWIN32__

> FWIW, filesystem defines such macro internally:
>
> # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX )
> # if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
> || defined(__CYGWIN__)
> # define BOOST_WINDOWS
> # else
> # define BOOST_POSIX
> # endif
> # endif

I like the single BOOST_XXX macro idea for all libraries, I would only
delete
__CYGWIN__, which defines POSIX compatibility.

And if you like, it is possible to do something like this to be complete:

BOOST_WIN32 : _WIN32 || WIN32
BOOST_WIN64 : _WIN64| WIN64
BOOST_WINDOWS : BOOST_WIN32 || BOOST_WIN64

Ferda

> - Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk