Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60681 - in trunk: boost/asio/detail libs/asio/doc
From: chris_at_[hidden]
Date: 2010-03-17 21:32:35


Author: chris_kohlhoff
Date: 2010-03-17 21:32:34 EDT (Wed, 17 Mar 2010)
New Revision: 60681
URL: http://svn.boost.org/trac/boost/changeset/60681

Log:
Define NOMINMAX for all Windows compilers, not just Cygwin. Users can define
BOOST_ASIO_NO_NOMINMAX to suppress this definition.

Text files modified:
   trunk/boost/asio/detail/socket_types.hpp | 8 +++++---
   trunk/libs/asio/doc/using.qbk | 9 +++++++++
   2 files changed, 14 insertions(+), 3 deletions(-)

Modified: trunk/boost/asio/detail/socket_types.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_types.hpp (original)
+++ trunk/boost/asio/detail/socket_types.hpp 2010-03-17 21:32:34 EDT (Wed, 17 Mar 2010)
@@ -68,13 +68,15 @@
 # define WIN32_LEAN_AND_MEAN
 # endif // !defined(WIN32_LEAN_AND_MEAN)
 # endif // !defined(BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN)
+# if !defined(BOOST_ASIO_NO_NOMINMAX)
+# if !defined(NOMINMAX)
+# define NOMINMAX 1
+# endif // !defined(NOMINMAX)
+# endif // !defined(BOOST_ASIO_NO_NOMINMAX)
 # if defined(__CYGWIN__)
 # if !defined(__USE_W32_SOCKETS)
 # error You must add -D__USE_W32_SOCKETS to your compiler options.
 # endif // !defined(__USE_W32_SOCKETS)
-# if !defined(NOMINMAX)
-# define NOMINMAX 1
-# endif // !defined(NOMINMAX)
 # endif // defined(__CYGWIN__)
 # include <winsock2.h>
 # include <ws2tcpip.h>

Modified: trunk/libs/asio/doc/using.qbk
==============================================================================
--- trunk/libs/asio/doc/using.qbk (original)
+++ trunk/libs/asio/doc/using.qbk 2010-03-17 21:32:34 EDT (Wed, 17 Mar 2010)
@@ -206,6 +206,15 @@
     ]
   ]
   [
+ [`BOOST_ASIO_NO_NOMINMAX`]
+ [
+ By default, Boost.Asio will automatically define `NOMINMAX` when
+ compiling for Windows, to suppress the definition of the `min()` and
+ `max()` macros. The presence of `BOOST_ASIO_NO_NOMINMAX` prevents
+ `NOMINMAX` from being defined.
+ ]
+ ]
+ [
     [`BOOST_ASIO_NO_DEFAULT_LINKED_LIBS`]
     [
       When compiling for Windows using Microsoft Visual C++ or Borland C++, Boost.Asio


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk