aboutsummaryrefslogtreecommitdiff
path: root/butl/config
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-01-02 02:28:26 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-01-04 14:58:29 +0300
commit0e8c95a08f87922575c9f400399258dba54df1ca (patch)
treeb5c064ed5045c8e0a93dfba0d69b0fb6bccc6e8b /butl/config
parent900a4504d6045071b9bd48bcea206f633f08c681 (diff)
Fix BUTL_CXX17_UNCAUGHT_EXCEPTIONS definition for Mac OS X
Diffstat (limited to 'butl/config')
-rw-r--r--butl/config13
1 files changed, 9 insertions, 4 deletions
diff --git a/butl/config b/butl/config
index 02209c5..dabbdc7 100644
--- a/butl/config
+++ b/butl/config
@@ -32,10 +32,15 @@
# define BUTL_CXX17_UNCAUGHT_EXCEPTIONS
//
// Clang's libc++ seems to have it for a while (but not before 1200) so we
-// assume it's there from 1200 (it doesn't define a feature test macros).
-//
-#elif _LIBCPP_VERSION >= 1200
-# define BUTL_CXX17_UNCAUGHT_EXCEPTIONS
+// assume it's there from 1200 (it doesn't define a feature test macros). But
+// not for Mac OS X, where it is explicitly marked unavailable until version
+// 10.12.
+//
+#elif defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 1200
+# if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101200
+# define BUTL_CXX17_UNCAUGHT_EXCEPTIONS
+# endif
//
// GCC libstdc++ has it since GCC 6 and it defines the feature test macro.
// We will also use this for any other runtime.