From cf4e798691d838b76fcc2832ea815569b0824d1a Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Fri, 2 Jul 2004 01:21:32 +0000 Subject: [PATCH] move BOOST_USING_STD_MIN and _MAX and BOOST_PREVENT_MACRO_SUBSTITUTION to the config headers, remove boost/minmax.hpp, update coding guidelines [SVN r23313] --- include/boost/config.hpp | 3 --- include/boost/config/stdlib/stlport.hpp | 9 +++++++++ include/boost/config/suffix.hpp | 12 ++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/include/boost/config.hpp b/include/boost/config.hpp index e091e62b..055a2785 100644 --- a/include/boost/config.hpp +++ b/include/boost/config.hpp @@ -53,9 +53,6 @@ # include BOOST_PLATFORM_CONFIG #endif -// used in various places to guard against the min/max macros -#define BOOST_PREVENT_MACRO_SUBSTITUTION - // get config suffix code: #include diff --git a/include/boost/config/stdlib/stlport.hpp b/include/boost/config/stdlib/stlport.hpp index 0410c922..044a87d9 100644 --- a/include/boost/config/stdlib/stlport.hpp +++ b/include/boost/config/stdlib/stlport.hpp @@ -167,6 +167,15 @@ namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; # undef BOOST_HAS_HASH #endif +// +// gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max +// +#if defined(__GNUC__) && (__GNUC__ < 3) +# include // for std::min and std::max +# define BOOST_USING_STD_MIN() ((void)0) +# define BOOST_USING_STD_MAX() ((void)0) +namespace boost { using std::min; using std::max; } +#endif #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT) diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index 7262aa26..5980c864 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -285,6 +285,18 @@ namespace std { using ::ptrdiff_t; using ::size_t; } # endif +// Workaround for the unfortunate min/max macros defined by some platform headers + +#define BOOST_PREVENT_MACRO_SUBSTITUTION + +#ifndef BOOST_USING_STD_MIN +# define BOOST_USING_STD_MIN() using std::min +#endif + +#ifndef BOOST_USING_STD_MAX +# define BOOST_USING_STD_MAX() using std::max +#endif + // BOOST_NO_STD_MIN_MAX workaround -----------------------------------------// # ifdef BOOST_NO_STD_MIN_MAX