|
@@ -108,6 +108,11 @@
|
|
|
// its vtable and typeinfo to libc++ rather than having all other libraries
|
|
|
// using that class define their own copies.
|
|
|
# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
|
|
|
+// Override the default return value of exception::what() for
|
|
|
+// bad_function_call::what() with a string that is specific to
|
|
|
+// bad_function_call (see http://wg21.link/LWG2233). This is an ABI break
|
|
|
+// because it changes the vtable layout of bad_function_call.
|
|
|
+# define _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE
|
|
|
// Enable optimized version of __do_get_(un)signed which avoids redundant copies.
|
|
|
# define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
|
|
|
// In C++20 and later, don't derive std::plus from std::binary_function,
|
|
@@ -153,6 +158,11 @@
|
|
|
// reduces the number of weak definitions generated in programs that use
|
|
|
// iostreams by providing a single strong definition in the shared library.
|
|
|
# define _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1
|
|
|
+
|
|
|
+// Define a key function for `bad_function_call` in the library, to centralize
|
|
|
+// its vtable and typeinfo to libc++ rather than having all other libraries
|
|
|
+// using that class define their own copies.
|
|
|
+# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
|
|
|
#endif
|
|
|
|
|
|
#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
|
|
@@ -897,16 +907,35 @@ typedef unsigned int char32_t;
|
|
|
// _LIBCPP_DEBUG potential values:
|
|
|
// - undefined: No assertions. This is the default.
|
|
|
// - 0: Basic assertions
|
|
|
-// - 1: Basic assertions + iterator validity checks.
|
|
|
-#if !defined(_LIBCPP_DEBUG)
|
|
|
-# define _LIBCPP_DEBUG_LEVEL 0
|
|
|
-#elif _LIBCPP_DEBUG == 0
|
|
|
-# define _LIBCPP_DEBUG_LEVEL 1
|
|
|
-#elif _LIBCPP_DEBUG == 1
|
|
|
-# define _LIBCPP_DEBUG_LEVEL 2
|
|
|
-#else
|
|
|
-# error Supported values for _LIBCPP_DEBUG are 0 and 1
|
|
|
-#endif
|
|
|
+// - 1: Basic assertions + iterator validity checks + unspecified behavior randomization.
|
|
|
+# if !defined(_LIBCPP_DEBUG)
|
|
|
+# define _LIBCPP_DEBUG_LEVEL 0
|
|
|
+# elif _LIBCPP_DEBUG == 0
|
|
|
+# define _LIBCPP_DEBUG_LEVEL 1
|
|
|
+# elif _LIBCPP_DEBUG == 1
|
|
|
+# define _LIBCPP_DEBUG_LEVEL 2
|
|
|
+# else
|
|
|
+# error Supported values for _LIBCPP_DEBUG are 0 and 1
|
|
|
+# endif
|
|
|
+
|
|
|
+# if _LIBCPP_DEBUG_LEVEL >= 2 && !defined(_LIBCPP_CXX03_LANG)
|
|
|
+# define _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
|
|
|
+# endif
|
|
|
+
|
|
|
+# if defined(_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY)
|
|
|
+# if defined(_LIBCPP_CXX03_LANG)
|
|
|
+# error Support for unspecified stability is only for C++11 and higher
|
|
|
+# endif
|
|
|
+# define _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last) \
|
|
|
+ do { \
|
|
|
+ if (!__builtin_is_constant_evaluated()) \
|
|
|
+ _VSTD::shuffle(__first, __last, __libcpp_debug_randomizer()); \
|
|
|
+ } while (false)
|
|
|
+# else
|
|
|
+# define _LIBCPP_DEBUG_RANDOMIZE_RANGE(__first, __last) \
|
|
|
+ do { \
|
|
|
+ } while (false)
|
|
|
+# endif
|
|
|
|
|
|
// Libc++ allows disabling extern template instantiation declarations by
|
|
|
// means of users defining _LIBCPP_DISABLE_EXTERN_TEMPLATE.
|