
Hello, in my library I use _WIN32 macro to detect the case when I'm on windows (e.g. to get the right header for 'environ'). However, Boost.Config has more complex logic: #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) // win32: .... 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? 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 - Volodya

Vladimir Prus <ghost@cs.msu.su> writes:
Hello, in my library I use _WIN32 macro to detect the case when I'm on windows (e.g. to get the right header for 'environ'). However, Boost.Config has more complex logic:
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) // win32: ....
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?
Yes and yes, IMO.
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
...which is strange because Cygwin is a Posix platform. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) // win32: ....
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?
Yes and yes, IMO.
What about the attached patch, then?
# 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
...which is strange because Cygwin is a Posix platform.
Yea, strange. It's bad that cygwin is not in regression tests.... - Volodya

Vladimir Prus <ghost@cs.msu.su> writes:
What about the attached patch, then?
I guess you'd better ask John Maddock. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

"John Maddock" <john@johnmaddock.co.uk> writes:
I guess you'd better ask John Maddock.
Sorry, this message just turned up in my inbox today :-(
What was the original question?
http://news.gmane.org/find-root.php?message_id=%3c200407161258.20178.ghost%4... I suggest subscribing to the GMane newsgroups; all thread histories are easily recoverable that way. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

http://news.gmane.org/find-root.php?message_id=%3c200407161258.20178.ghost%4... OK, got it, I'll apply the patches: BOOST_WINDOWS will be in the config system shortly. Thanks, John.
participants (3)
-
David Abrahams
-
John Maddock
-
Vladimir Prus