>From 9581fd85a52c9e2cf4af3e76f175df00601cef0e Mon Sep 17 00:00:00 2001
From: Stephen Kelly <stephen.kelly@kdab.com>
Date: Sat, 12 Oct 2013 02:29:40 +0200
Subject: [PATCH] Require a SFINAE capable compiler.

This effectively drops support for Borland 5.x, Metrowerks prior
to 9.0, and SunPro prior to 5.7.

Compilers based on EDG 238 are also affected, though it is unknown
what those are.
---
 boost/config/compiler/borland.hpp     | 128 +++++-----------------------------
 boost/config/compiler/common_edg.hpp  |   5 --
 boost/config/compiler/digitalmars.hpp |   1 -
 boost/config/compiler/metrowerks.hpp  |  22 +-----
 boost/config/compiler/sunpro_cc.hpp   |  12 +---
 5 files changed, 19 insertions(+), 149 deletions(-)

diff --git a/boost/config/compiler/borland.hpp b/boost/config/compiler/borland.hpp
index a8f5baa..4287d55 100644
--- a/boost/config/compiler/borland.hpp
+++ b/boost/config/compiler/borland.hpp
@@ -11,8 +11,8 @@
 
 //
 // versions check:
-// we don't support Borland prior to version 5.4:
-#if __BORLANDC__ < 0x540
+// we don't support Borland prior to version 6:
+#if __BORLANDC__ <= 0x600
 #  error "Compiler not supported or configured - please reconfigure"
 #endif
 
@@ -23,96 +23,16 @@
 //#  else
 //#     pragma message( "Unknown compiler version - please run the configure tests and report the results")
 //#  endif
-#elif (__BORLANDC__ == 0x600)
-#  error "CBuilderX preview compiler is no longer supported"
 #endif
 
 //
 // Support macros to help with standard library detection
-#if (__BORLANDC__ < 0x560) || defined(_USE_OLD_RW_STL)
+#if defined(_USE_OLD_RW_STL)
 #  define BOOST_BCB_WITH_ROGUE_WAVE
-#elif __BORLANDC__ < 0x570
-#  define BOOST_BCB_WITH_STLPORT
 #else
 #  define BOOST_BCB_WITH_DINKUMWARE
 #endif
 
-//
-// Version 5.0 and below:
-#   if __BORLANDC__ <= 0x0550
-// Borland C++Builder 4 and 5:
-#     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
-#     if __BORLANDC__ == 0x0550
-// Borland C++Builder 5, command-line compiler 5.5:
-#       define BOOST_NO_OPERATORS_IN_NAMESPACE
-#     endif
-// Variadic macros do not exist for C++ Builder versions 5 and below
-#define BOOST_NO_CXX11_VARIADIC_MACROS
-#   endif
-
-// Version 5.51 and below:
-#if (__BORLANDC__ <= 0x551)
-#  define BOOST_NO_CV_SPECIALIZATIONS
-#  define BOOST_NO_CV_VOID_SPECIALIZATIONS
-#  define BOOST_NO_DEDUCED_TYPENAME
-// workaround for missing WCHAR_MAX/WCHAR_MIN:
-#ifdef __cplusplus
-#include <climits>
-#include <cwchar>
-#else
-#include <limits.h>
-#include <wchar.h>
-#endif // __cplusplus
-#ifndef WCHAR_MAX
-#  define WCHAR_MAX 0xffff
-#endif
-#ifndef WCHAR_MIN
-#  define WCHAR_MIN 0
-#endif
-#endif
-
-// Borland C++ Builder 6 and below:
-#if (__BORLANDC__ <= 0x564)
-
-#  if defined(NDEBUG) && defined(__cplusplus)
-      // fix broken <cstring> so that Boost.test works:
-#     include <cstring>
-#     undef strcmp
-#  endif
-   // fix broken errno declaration:
-#  include <errno.h>
-#  ifndef errno
-#     define errno errno
-#  endif
-
-#endif
-
-//
-// new bug in 5.61:
-#if (__BORLANDC__ >= 0x561) && (__BORLANDC__ <= 0x580)
-   // this seems to be needed by the command line compiler, but not the IDE:
-#  define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
-#endif
-
-// Borland C++ Builder 2006 Update 2 and below:
-#if (__BORLANDC__ <= 0x582)
-#  define BOOST_NO_SFINAE
-#  define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
-#  define BOOST_NO_TEMPLATE_TEMPLATES
-
-#  define BOOST_NO_PRIVATE_IN_AGGREGATE
-
-#  ifdef _WIN32
-#     define BOOST_NO_SWPRINTF
-#  elif defined(linux) || defined(__linux__) || defined(__linux)
-      // we should really be able to do without this
-      // but the wcs* functions aren't imported into std::
-#     define BOOST_NO_STDC_NAMESPACE
-      // _CPPUNWIND doesn't get automatically set for some reason:
-#     pragma defineonoption BOOST_CPPUNWIND -x
-#  endif
-#endif
-
 #if (__BORLANDC__ <= 0x613)  // Beman has asked Alisdair for more info
    // we shouldn't really need this - but too many things choke
    // without it, this needs more investigation:
@@ -135,17 +55,11 @@
 #  define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
 #  define BOOST_NO_NESTED_FRIENDSHIP
 #  define BOOST_NO_TYPENAME_WITH_CTOR
-#if (__BORLANDC__ < 0x600)
-#  define BOOST_ILLEGAL_CV_REFERENCES
-#endif
 
 //
 //  Positive Feature detection
 //
-// Borland C++ Builder 2008 and below:
-#if (__BORLANDC__ >= 0x599)
-#  pragma defineonoption BOOST_CODEGEAR_0X_SUPPORT -Ax
-#endif
+#pragma defineonoption BOOST_CODEGEAR_0X_SUPPORT -Ax
 //
 // C++0x Macros:
 //
@@ -195,24 +109,18 @@
 #define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
 #define BOOST_NO_CXX11_INLINE_NAMESPACES
 
-#if __BORLANDC__ >= 0x590
-#  define BOOST_HAS_TR1_HASH
+#define BOOST_HAS_TR1_HASH
 
-#  define BOOST_HAS_MACRO_USE_FACET
-#endif
+#define BOOST_HAS_MACRO_USE_FACET
 
-//
-// Post 0x561 we have long long and stdint.h:
-#if __BORLANDC__ >= 0x561
-#  ifndef __NO_LONG_LONG
-#     define BOOST_HAS_LONG_LONG
-#  else
-#     define BOOST_NO_LONG_LONG
-#  endif
-   // On non-Win32 platforms let the platform config figure this out:
-#  ifdef _WIN32
-#      define BOOST_HAS_STDINT_H
-#  endif
+#ifndef __NO_LONG_LONG
+#   define BOOST_HAS_LONG_LONG
+#else
+#   define BOOST_NO_LONG_LONG
+#endif
+ // On non-Win32 platforms let the platform config figure this out:
+#ifdef _WIN32
+#    define BOOST_HAS_STDINT_H
 #endif
 
 // Borland C++Builder 6 defaults to using STLPort.  If _USE_OLD_RW_STL is
@@ -227,7 +135,7 @@
 //
 // __int64:
 //
-#if (__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)
+#if !defined(__STRICT_ANSI__)
 #  define BOOST_HAS_MS_INT64
 #endif
 //
@@ -252,20 +160,16 @@
 //
 // ABI fixing headers:
 //
-#if __BORLANDC__ != 0x600 // not implemented for version 6 compiler yet
 #ifndef BOOST_ABI_PREFIX
 #  define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp"
 #endif
 #ifndef BOOST_ABI_SUFFIX
 #  define BOOST_ABI_SUFFIX "boost/config/abi/borland_suffix.hpp"
 #endif
-#endif
 //
 // Disable Win32 support in ANSI mode:
 //
-#if __BORLANDC__ < 0x600
-#  pragma defineonoption BOOST_DISABLE_WIN32 -A
-#elif defined(__STRICT_ANSI__)
+#if defined(__STRICT_ANSI__)
 #  define BOOST_DISABLE_WIN32
 #endif
 //
diff --git a/boost/config/compiler/common_edg.hpp b/boost/config/compiler/common_edg.hpp
index 70e7efa..6e15c2a 100644
--- a/boost/config/compiler/common_edg.hpp
+++ b/boost/config/compiler/common_edg.hpp
@@ -18,11 +18,6 @@
 #  error This file requires that __EDG_VERSION__ be defined.
 #endif
 
-#if (__EDG_VERSION__ <= 238)
-#   define BOOST_NO_INTEGRAL_INT64_T
-#   define BOOST_NO_SFINAE
-#endif
-
 #if (__EDG_VERSION__ <= 240)
 #   define BOOST_NO_VOID_RETURNS
 #endif
diff --git a/boost/config/compiler/digitalmars.hpp b/boost/config/compiler/digitalmars.hpp
index 7de6adb..20c2dcc 100644
--- a/boost/config/compiler/digitalmars.hpp
+++ b/boost/config/compiler/digitalmars.hpp
@@ -15,7 +15,6 @@
 #define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 #define BOOST_NO_OPERATORS_IN_NAMESPACE
 #define BOOST_NO_UNREACHABLE_RETURN_DETECTION
-#define BOOST_NO_SFINAE
 #define BOOST_NO_USING_TEMPLATE
 #define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
 #endif
diff --git a/boost/config/compiler/metrowerks.hpp b/boost/config/compiler/metrowerks.hpp
index e172786..0d6c65a 100644
--- a/boost/config/compiler/metrowerks.hpp
+++ b/boost/config/compiler/metrowerks.hpp
@@ -17,26 +17,6 @@
 #     define BOOST_NO_STD_LOCALE
 #   endif
 
-#   if __MWERKS__ <= 0x2301  // 5.3
-#     define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
-#     define BOOST_NO_POINTER_TO_MEMBER_CONST
-#     define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
-#     define BOOST_NO_MEMBER_TEMPLATE_KEYWORD
-#   endif
-
-#   if __MWERKS__ <= 0x2401  // 6.2
-//#     define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
-#   endif
-
-#   if(__MWERKS__ <= 0x2407)  // 7.x
-#     define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
-#     define BOOST_NO_UNREACHABLE_RETURN_DETECTION
-#   endif
-
-#   if(__MWERKS__ <= 0x3003)  // 8.x
-#     define BOOST_NO_SFINAE
-#    endif
-
 // the "|| !defined(BOOST_STRICT_CONFIG)" part should apply to the last
 // tested version *only*:
 #   if(__MWERKS__ <= 0x3207) || !defined(BOOST_STRICT_CONFIG) // 9.6
@@ -129,7 +109,7 @@
 //
 // versions check:
 // we don't support Metrowerks prior to version 5.3:
-#if __MWERKS__ < 0x2301
+#if __MWERKS__ < 0x3207
 #  error "Compiler not supported or configured - please reconfigure"
 #endif
 //
diff --git a/boost/config/compiler/sunpro_cc.hpp b/boost/config/compiler/sunpro_cc.hpp
index 73cff7d..8ff4e3a 100644
--- a/boost/config/compiler/sunpro_cc.hpp
+++ b/boost/config/compiler/sunpro_cc.hpp
@@ -11,14 +11,6 @@
 
 //  Sun C++ compiler setup:
 
-#    if (__SUNPRO_CC < 0x570)
-#      define BOOST_NO_TEMPLATE_TEMPLATES
-       // see http://lists.boost.org/MailArchives/boost/msg47184.php
-       // and http://lists.boost.org/MailArchives/boost/msg47220.php
-#      define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
-#      define BOOST_NO_SFINAE
-#      define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
-#    endif
 #    if (__SUNPRO_CC <= 0x580)
 #      define BOOST_NO_IS_ABSTRACT
 #    endif
@@ -91,8 +83,8 @@
 
 //
 // versions check:
-// we don't support sunpro prior to version 5.4.
-#if __SUNPRO_CC < 0x540
+// we don't support sunpro prior to version 5.7.
+#if __SUNPRO_CC < 0x570
 #error "Compiler not supported or configured - please reconfigure"
 #endif
 //
-- 
1.8.1.2

