diff options
Diffstat (limited to 'include/__config')
-rw-r--r-- | include/__config | 105 |
1 files changed, 69 insertions, 36 deletions
diff --git a/include/__config b/include/__config index f15d2d06e564..d0f95ef28342 100644 --- a/include/__config +++ b/include/__config @@ -33,7 +33,7 @@ #define _GNUC_VER_NEW 0 #endif -#define _LIBCPP_VERSION 5000 +#define _LIBCPP_VERSION 6000 #ifndef _LIBCPP_ABI_VERSION #define _LIBCPP_ABI_VERSION 1 @@ -45,6 +45,8 @@ #define _LIBCPP_OBJECT_FORMAT_MACHO 1 #elif defined(_WIN32) #define _LIBCPP_OBJECT_FORMAT_COFF 1 +#elif defined(__wasm__) +#define _LIBCPP_OBJECT_FORMAT_WASM 1 #else #error Unknown object file format #endif @@ -55,11 +57,11 @@ #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT // Fix deque iterator type in order to support incomplete types. #define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE -// Fix undefined behavior in how std::list stores it's linked nodes. +// Fix undefined behavior in how std::list stores its linked nodes. #define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB // Fix undefined behavior in how __tree stores its end and parent nodes. #define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB -// Fix undefined behavior in how __hash_table stores it's pointer types +// Fix undefined behavior in how __hash_table stores its pointer types. #define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB #define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB #define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE @@ -76,9 +78,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 - // Enable optimized version of __do_get_(un)signed which avoids redundant copies. #define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET +// Use the smallest possible integer type to represent the index of the variant. +// Previously libc++ used "unsigned int" exclusivly. +#define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION #elif _LIBCPP_ABI_VERSION == 1 #if !defined(_LIBCPP_OBJECT_FORMAT_COFF) // Enable compiling copies of now inline methods into the dylib to support @@ -121,6 +125,9 @@ #ifndef __has_feature #define __has_feature(__x) 0 #endif +#ifndef __has_cpp_attribute +#define __has_cpp_attribute(__x) 0 +#endif // '__is_identifier' returns '0' if '__x' is a reserved identifier provided by // the compiler and '1' otherwise. #ifndef __is_identifier @@ -157,11 +164,21 @@ // FIXME: ABI detection should be done via compiler builtin macros. This // is just a placeholder until Clang implements such macros. For now assume -// that Windows compilers pretending to be MSVC++ target the microsoft ABI. -#if defined(_WIN32) && defined(_MSC_VER) +// that Windows compilers pretending to be MSVC++ target the Microsoft ABI, +// and allow the user to explicitly specify the ABI to handle cases where this +// heuristic falls short. +#if defined(_LIBCPP_ABI_FORCE_ITANIUM) && defined(_LIBCPP_ABI_FORCE_MICROSOFT) +# error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined" +#elif defined(_LIBCPP_ABI_FORCE_ITANIUM) +# define _LIBCPP_ABI_ITANIUM +#elif defined(_LIBCPP_ABI_FORCE_MICROSOFT) # define _LIBCPP_ABI_MICROSOFT #else -# define _LIBCPP_ABI_ITANIUM +# if defined(_WIN32) && defined(_MSC_VER) +# define _LIBCPP_ABI_MICROSOFT +# else +# define _LIBCPP_ABI_ITANIUM +# endif #endif // Need to detect which libc we're using if we're on Linux. @@ -174,36 +191,30 @@ #ifdef __LITTLE_ENDIAN__ #if __LITTLE_ENDIAN__ -#define _LIBCPP_LITTLE_ENDIAN 1 -#define _LIBCPP_BIG_ENDIAN 0 +#define _LIBCPP_LITTLE_ENDIAN #endif // __LITTLE_ENDIAN__ #endif // __LITTLE_ENDIAN__ #ifdef __BIG_ENDIAN__ #if __BIG_ENDIAN__ -#define _LIBCPP_LITTLE_ENDIAN 0 -#define _LIBCPP_BIG_ENDIAN 1 +#define _LIBCPP_BIG_ENDIAN #endif // __BIG_ENDIAN__ #endif // __BIG_ENDIAN__ #ifdef __BYTE_ORDER__ #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -#define _LIBCPP_LITTLE_ENDIAN 1 -#define _LIBCPP_BIG_ENDIAN 0 +#define _LIBCPP_LITTLE_ENDIAN #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define _LIBCPP_LITTLE_ENDIAN 0 -#define _LIBCPP_BIG_ENDIAN 1 +#define _LIBCPP_BIG_ENDIAN #endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ #endif // __BYTE_ORDER__ #ifdef __FreeBSD__ # include <sys/endian.h> # if _BYTE_ORDER == _LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN 1 -# define _LIBCPP_BIG_ENDIAN 0 +# define _LIBCPP_LITTLE_ENDIAN # else // _BYTE_ORDER == _LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN 0 -# define _LIBCPP_BIG_ENDIAN 1 +# define _LIBCPP_BIG_ENDIAN # endif // _BYTE_ORDER == _LITTLE_ENDIAN # ifndef __LONG_LONG_SUPPORTED # define _LIBCPP_HAS_NO_LONG_LONG @@ -213,19 +224,16 @@ #ifdef __NetBSD__ # include <sys/endian.h> # if _BYTE_ORDER == _LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN 1 -# define _LIBCPP_BIG_ENDIAN 0 +# define _LIBCPP_LITTLE_ENDIAN # else // _BYTE_ORDER == _LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN 0 -# define _LIBCPP_BIG_ENDIAN 1 +# define _LIBCPP_BIG_ENDIAN # endif // _BYTE_ORDER == _LITTLE_ENDIAN # define _LIBCPP_HAS_QUICK_EXIT #endif // __NetBSD__ #if defined(_WIN32) # define _LIBCPP_WIN32API -# define _LIBCPP_LITTLE_ENDIAN 1 -# define _LIBCPP_BIG_ENDIAN 0 +# define _LIBCPP_LITTLE_ENDIAN # define _LIBCPP_SHORT_WCHAR 1 // Both MinGW and native MSVC provide a "MSVC"-like enviroment # define _LIBCPP_MSVCRT_LIKE @@ -255,11 +263,9 @@ #ifdef __sun__ # include <sys/isa_defs.h> # ifdef _LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN 1 -# define _LIBCPP_BIG_ENDIAN 0 +# define _LIBCPP_LITTLE_ENDIAN # else -# define _LIBCPP_LITTLE_ENDIAN 0 -# define _LIBCPP_BIG_ENDIAN 1 +# define _LIBCPP_BIG_ENDIAN # endif #endif // __sun__ @@ -269,6 +275,8 @@ // random data even when using sandboxing mechanisms such as chroots, // Capsicum, etc. # define _LIBCPP_USING_ARC4_RANDOM +#elif defined(__Fuchsia__) +# define _LIBCPP_USING_GETENTROPY #elif defined(__native_client__) // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access, // including accesses to the special files under /dev. C++11's @@ -280,18 +288,16 @@ # define _LIBCPP_USING_DEV_RANDOM #endif -#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) +#if !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN) # include <endian.h> # if __BYTE_ORDER == __LITTLE_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN 1 -# define _LIBCPP_BIG_ENDIAN 0 +# define _LIBCPP_LITTLE_ENDIAN # elif __BYTE_ORDER == __BIG_ENDIAN -# define _LIBCPP_LITTLE_ENDIAN 0 -# define _LIBCPP_BIG_ENDIAN 1 +# define _LIBCPP_BIG_ENDIAN # else // __BYTE_ORDER == __BIG_ENDIAN # error unable to determine endian # endif -#endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) +#endif // !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN) #if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC) #define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi"))) @@ -454,6 +460,10 @@ namespace std { #define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow"))) #endif +#if __has_builtin(__builtin_launder) +#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER +#endif + #elif defined(_LIBCPP_COMPILER_GCC) #define _ALIGNAS(x) __attribute__((__aligned__(x))) @@ -536,6 +546,10 @@ namespace std { #define _LIBCPP_HAS_NO_ASAN #endif +#if _GNUC_VER >= 700 +#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER +#endif + #elif defined(_LIBCPP_COMPILER_MSVC) #define _LIBCPP_TOSTRING2(x) #x @@ -880,7 +894,7 @@ template <unsigned> struct __static_assert_check {}; #define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63) #endif -#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT) || \ +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || \ defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__) #define _LIBCPP_LOCALE__L_EXTENSIONS 1 #endif @@ -954,6 +968,18 @@ template <unsigned> struct __static_assert_check {}; #define _LIBCPP_CONSTEXPR_AFTER_CXX14 #endif +#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) +#define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr +#else +#define _LIBCPP_CONSTEXPR_AFTER_CXX17 +#endif + +#if __has_cpp_attribute(nodiscard) && _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17) +#define _LIBCPP_NODISCARD_AFTER_CXX17 [[nodiscard]] +#else +#define _LIBCPP_NODISCARD_AFTER_CXX17 +#endif + // FIXME: Remove all usages of this macro once compilers catch up. #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606L) # define _LIBCPP_HAS_NO_INLINE_VARIABLES @@ -1241,6 +1267,13 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( # endif #endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO) +#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) +# if defined(_DLL) +# pragma(lib, "c++.lib") +# else +# pragma(lib, "libc++.lib") +# endif +#endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) #endif // __cplusplus |