2 //===--------------------------- __config ---------------------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef _LIBCPP_CONFIG
12 #define _LIBCPP_CONFIG
14 #if !defined(_MSC_VER) || defined(__clang__)
15 #pragma GCC system_header
19 #define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
24 #include <errno.h> // for ELAST on FreeBSD
27 #define _LIBCPP_VERSION 1101
29 #define _LIBCPP_ABI_VERSION 1
31 #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
32 #define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y)
34 #define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)
36 #ifdef __LITTLE_ENDIAN__
38 #define _LIBCPP_LITTLE_ENDIAN 1
39 #define _LIBCPP_BIG_ENDIAN 0
40 #endif // __LITTLE_ENDIAN__
41 #endif // __LITTLE_ENDIAN__
45 #define _LIBCPP_LITTLE_ENDIAN 0
46 #define _LIBCPP_BIG_ENDIAN 1
47 #endif // __BIG_ENDIAN__
48 #endif // __BIG_ENDIAN__
51 # include <sys/endian.h>
52 # if _BYTE_ORDER == _LITTLE_ENDIAN
53 # define _LIBCPP_LITTLE_ENDIAN 1
54 # define _LIBCPP_BIG_ENDIAN 0
55 # else // _BYTE_ORDER == _LITTLE_ENDIAN
56 # define _LIBCPP_LITTLE_ENDIAN 0
57 # define _LIBCPP_BIG_ENDIAN 1
58 # endif // _BYTE_ORDER == _LITTLE_ENDIAN
59 # ifndef __LONG_LONG_SUPPORTED
60 # define _LIBCPP_HAS_NO_LONG_LONG
61 # endif // __LONG_LONG_SUPPORTED
65 # include <sys/endian.h>
66 # if _BYTE_ORDER == _LITTLE_ENDIAN
67 # define _LIBCPP_LITTLE_ENDIAN 1
68 # define _LIBCPP_BIG_ENDIAN 0
69 # else // _BYTE_ORDER == _LITTLE_ENDIAN
70 # define _LIBCPP_LITTLE_ENDIAN 0
71 # define _LIBCPP_BIG_ENDIAN 1
72 # endif // _BYTE_ORDER == _LITTLE_ENDIAN
73 # define _LIBCPP_HAS_QUICK_EXIT
77 # define _LIBCPP_LITTLE_ENDIAN 1
78 # define _LIBCPP_BIG_ENDIAN 0
79 // Compiler intrinsics (GCC or MSVC)
80 # if defined(__clang__) \
81 || (defined(_MSC_VER) && _MSC_VER >= 1400) \
82 || (defined(__GNUC__) && _GNUC_VER > 403)
83 # define _LIBCPP_HAS_IS_BASE_OF
85 # if defined(_MSC_VER) && !defined(__clang__)
86 # define _LIBCPP_MSVC // Using Microsoft Visual C++ compiler
87 # define _LIBCPP_TOSTRING2(x) #x
88 # define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
89 # define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x))
91 # // If mingw not explicitly detected, assume using MS C runtime only.
93 # define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
98 # if defined(__GNUC__) && _GNUC_VER >= 403
99 # define _LIBCPP_HAS_IS_BASE_OF
104 # include <sys/isa_defs.h>
105 # ifdef _LITTLE_ENDIAN
106 # define _LIBCPP_LITTLE_ENDIAN 1
107 # define _LIBCPP_BIG_ENDIAN 0
109 # define _LIBCPP_LITTLE_ENDIAN 0
110 # define _LIBCPP_BIG_ENDIAN 1
114 #if defined(__native_client__)
115 // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
116 // including accesses to the special files under /dev. C++11's
117 // std::random_device is instead exposed through a NaCl syscall.
118 # define _LIBCPP_USING_NACL_RANDOM
119 #endif // defined(__native_client__)
121 #if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
123 # if __BYTE_ORDER == __LITTLE_ENDIAN
124 # define _LIBCPP_LITTLE_ENDIAN 1
125 # define _LIBCPP_BIG_ENDIAN 0
126 # elif __BYTE_ORDER == __BIG_ENDIAN
127 # define _LIBCPP_LITTLE_ENDIAN 0
128 # define _LIBCPP_BIG_ENDIAN 1
129 # else // __BYTE_ORDER == __BIG_ENDIAN
130 # error unable to determine endian
132 #endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
136 // only really useful for a DLL
137 #ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally...
139 # define _LIBCPP_HIDDEN
140 # define _LIBCPP_FUNC_VIS __declspec(dllexport)
141 # define _LIBCPP_TYPE_VIS __declspec(dllexport)
143 # define _LIBCPP_HIDDEN
144 # define _LIBCPP_FUNC_VIS __declspec(dllimport)
145 # define _LIBCPP_TYPE_VIS __declspec(dllimport)
148 # define _LIBCPP_HIDDEN
149 # define _LIBCPP_FUNC_VIS
150 # define _LIBCPP_TYPE_VIS
153 #define _LIBCPP_TYPE_VIS_ONLY
154 #define _LIBCPP_FUNC_VIS_ONLY
156 #ifndef _LIBCPP_INLINE_VISIBILITY
158 # define _LIBCPP_INLINE_VISIBILITY __forceinline
159 # else // MinGW GCC and Clang
160 # define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
164 #ifndef _LIBCPP_EXCEPTION_ABI
165 #define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
168 #ifndef _LIBCPP_ALWAYS_INLINE
170 # define _LIBCPP_ALWAYS_INLINE __forceinline
176 #ifndef __has_attribute
177 #define __has_attribute(__x) 0
180 #ifndef _LIBCPP_HIDDEN
181 #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
184 #ifndef _LIBCPP_FUNC_VIS
185 #define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
188 #ifndef _LIBCPP_TYPE_VIS
189 # if __has_attribute(__type_visibility__)
190 # define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
192 # define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
196 #ifndef _LIBCPP_TYPE_VIS_ONLY
197 # define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS
200 #ifndef _LIBCPP_FUNC_VIS_ONLY
201 # define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS
204 #ifndef _LIBCPP_INLINE_VISIBILITY
205 #define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
208 #ifndef _LIBCPP_EXCEPTION_ABI
209 #define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
212 #ifndef _LIBCPP_ALWAYS_INLINE
213 #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
216 #if defined(__clang__)
218 #if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
220 #define _LIBCPP_ALTERNATE_STRING_LAYOUT
223 #if __has_feature(cxx_alignas)
224 # define _ALIGNAS_TYPE(x) alignas(x)
225 # define _ALIGNAS(x) alignas(x)
227 # define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
228 # define _ALIGNAS(x) __attribute__((__aligned__(x)))
231 #if !__has_feature(cxx_alias_templates)
232 #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
235 #if __cplusplus < 201103L
236 typedef __char16_t char16_t;
237 typedef __char32_t char32_t;
240 #if !(__has_feature(cxx_exceptions))
241 #define _LIBCPP_NO_EXCEPTIONS
244 #if !(__has_feature(cxx_rtti))
245 #define _LIBCPP_NO_RTTI
248 #if !(__has_feature(cxx_strong_enums))
249 #define _LIBCPP_HAS_NO_STRONG_ENUMS
252 #if !(__has_feature(cxx_decltype))
253 #define _LIBCPP_HAS_NO_DECLTYPE
256 #if __has_feature(cxx_attributes)
257 # define _LIBCPP_NORETURN [[noreturn]]
259 # define _LIBCPP_NORETURN __attribute__ ((noreturn))
262 #define _LIBCPP_UNUSED __attribute__((__unused__))
264 #if !(__has_feature(cxx_defaulted_functions))
265 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
266 #endif // !(__has_feature(cxx_defaulted_functions))
268 #if !(__has_feature(cxx_deleted_functions))
269 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
270 #endif // !(__has_feature(cxx_deleted_functions))
272 #if !(__has_feature(cxx_lambdas))
273 #define _LIBCPP_HAS_NO_LAMBDAS
276 #if !(__has_feature(cxx_nullptr))
277 #define _LIBCPP_HAS_NO_NULLPTR
280 #if !(__has_feature(cxx_rvalue_references))
281 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
284 #if !(__has_feature(cxx_static_assert))
285 #define _LIBCPP_HAS_NO_STATIC_ASSERT
288 #if !(__has_feature(cxx_auto_type))
289 #define _LIBCPP_HAS_NO_AUTO_TYPE
292 #if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return)
293 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
296 #if !(__has_feature(cxx_variadic_templates))
297 #define _LIBCPP_HAS_NO_VARIADICS
300 #if !(__has_feature(cxx_trailing_return))
301 #define _LIBCPP_HAS_NO_TRAILING_RETURN
304 #if !(__has_feature(cxx_generalized_initializers))
305 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
308 #if __has_feature(is_base_of)
309 # define _LIBCPP_HAS_IS_BASE_OF
312 // Objective-C++ features (opt-in)
313 #if __has_feature(objc_arc)
314 #define _LIBCPP_HAS_OBJC_ARC
317 #if __has_feature(objc_arc_weak)
318 #define _LIBCPP_HAS_OBJC_ARC_WEAK
319 #define _LIBCPP_HAS_NO_STRONG_ENUMS
322 #if !(__has_feature(cxx_constexpr))
323 #define _LIBCPP_HAS_NO_CONSTEXPR
326 #if !(__has_feature(cxx_relaxed_constexpr))
327 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
330 #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
331 #if defined(__FreeBSD__)
332 #define _LIBCPP_HAS_QUICK_EXIT
333 #define _LIBCPP_HAS_C11_FEATURES
334 #elif defined(__ANDROID__)
335 #define _LIBCPP_HAS_QUICK_EXIT
336 #elif defined(__linux__)
337 #include <features.h>
338 #if __GLIBC_PREREQ(2, 15)
339 #define _LIBCPP_HAS_QUICK_EXIT
341 #if __GLIBC_PREREQ(2, 17)
342 #define _LIBCPP_HAS_C11_FEATURES
347 #if (__has_feature(cxx_noexcept))
348 # define _NOEXCEPT noexcept
349 # define _NOEXCEPT_(x) noexcept(x)
350 # define _NOEXCEPT_OR_FALSE(x) noexcept(x)
352 # define _NOEXCEPT throw()
353 # define _NOEXCEPT_(x)
354 # define _NOEXCEPT_OR_FALSE(x) false
357 #if __has_feature(underlying_type)
358 # define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
361 #if __has_feature(is_literal)
362 # define _LIBCPP_IS_LITERAL(T) __is_literal(T)
365 // Inline namespaces are available in Clang regardless of C++ dialect.
366 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
367 #define _LIBCPP_END_NAMESPACE_STD } }
368 #define _VSTD std::_LIBCPP_NAMESPACE
371 inline namespace _LIBCPP_NAMESPACE {
375 #if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer)
376 #define _LIBCPP_HAS_NO_ASAN
379 #elif defined(__GNUC__)
381 #define _ALIGNAS(x) __attribute__((__aligned__(x)))
382 #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
384 #define _LIBCPP_NORETURN __attribute__((noreturn))
386 #define _LIBCPP_UNUSED __attribute__((__unused__))
389 #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
390 #define _LIBCPP_IS_LITERAL(T) __is_literal_type(T)
394 #define _LIBCPP_NO_EXCEPTIONS
397 #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
399 // constexpr was added to GCC in 4.6.
401 #define _LIBCPP_HAS_NO_CONSTEXPR
402 // Can only use constexpr in c++11 mode.
403 #elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
404 #define _LIBCPP_HAS_NO_CONSTEXPR
407 // No version of GCC supports relaxed constexpr rules
408 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
410 #define _NOEXCEPT throw()
411 #define _NOEXCEPT_(x)
412 #define _NOEXCEPT_OR_FALSE(x) false
414 #ifndef __GXX_EXPERIMENTAL_CXX0X__
416 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
417 #define _LIBCPP_HAS_NO_DECLTYPE
418 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
419 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
420 #define _LIBCPP_HAS_NO_NULLPTR
421 #define _LIBCPP_HAS_NO_STATIC_ASSERT
422 #define _LIBCPP_HAS_NO_UNICODE_CHARS
423 #define _LIBCPP_HAS_NO_VARIADICS
424 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
425 #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
426 #define _LIBCPP_HAS_NO_STRONG_ENUMS
428 #else // __GXX_EXPERIMENTAL_CXX0X__
430 #define _LIBCPP_HAS_NO_TRAILING_RETURN
431 #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
434 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
438 #define _LIBCPP_HAS_NO_STATIC_ASSERT
442 #define _LIBCPP_HAS_NO_DECLTYPE
443 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
444 #define _LIBCPP_HAS_NO_UNICODE_CHARS
445 #define _LIBCPP_HAS_NO_VARIADICS
446 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
447 #endif // _GNUC_VER < 404
450 #define _LIBCPP_HAS_NO_NULLPTR
454 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
455 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
458 #endif // __GXX_EXPERIMENTAL_CXX0X__
460 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE {
461 #define _LIBCPP_END_NAMESPACE_STD } }
462 #define _VSTD std::_LIBCPP_NAMESPACE
465 namespace _LIBCPP_NAMESPACE {
467 using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
470 #if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__)
471 #define _LIBCPP_HAS_NO_ASAN
474 #elif defined(_LIBCPP_MSVC)
476 #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
477 #define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
478 #define _LIBCPP_HAS_NO_CONSTEXPR
479 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
480 #define _LIBCPP_HAS_NO_UNICODE_CHARS
481 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
482 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
483 #define __alignof__ __alignof
484 #define _LIBCPP_NORETURN __declspec(noreturn)
485 #define _LIBCPP_UNUSED
486 #define _ALIGNAS(x) __declspec(align(x))
487 #define _LIBCPP_HAS_NO_VARIADICS
489 #define _NOEXCEPT throw ()
490 #define _NOEXCEPT_(x)
491 #define _NOEXCEPT_OR_FALSE(x) false
493 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
494 #define _LIBCPP_END_NAMESPACE_STD }
497 # define _LIBCPP_WEAK
501 #define _LIBCPP_HAS_NO_ASAN
503 #elif defined(__IBMCPP__)
505 #define _ALIGNAS(x) __attribute__((__aligned__(x)))
506 #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
507 #define _ATTRIBUTE(x) __attribute__((x))
508 #define _LIBCPP_NORETURN __attribute__((noreturn))
509 #define _LIBCPP_UNUSED
511 #define _NOEXCEPT throw()
512 #define _NOEXCEPT_(x)
513 #define _NOEXCEPT_OR_FALSE(x) false
515 #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
516 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
517 #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
518 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
519 #define _LIBCPP_HAS_NO_NULLPTR
520 #define _LIBCPP_HAS_NO_UNICODE_CHARS
521 #define _LIBCPP_HAS_IS_BASE_OF
524 #define __MULTILOCALE_API
527 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
528 #define _LIBCPP_END_NAMESPACE_STD } }
529 #define _VSTD std::_LIBCPP_NAMESPACE
532 inline namespace _LIBCPP_NAMESPACE {
536 #define _LIBCPP_HAS_NO_ASAN
538 #endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__
540 #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
541 typedef unsigned short char16_t;
542 typedef unsigned int char32_t;
543 #endif // _LIBCPP_HAS_NO_UNICODE_CHARS
545 #ifndef __SIZEOF_INT128__
546 #define _LIBCPP_HAS_NO_INT128
549 #ifdef _LIBCPP_HAS_NO_STATIC_ASSERT
551 template <bool> struct __static_assert_test;
552 template <> struct __static_assert_test<true> {};
553 template <unsigned> struct __static_assert_check {};
554 #define static_assert(__b, __m) \
555 typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
556 _LIBCPP_CONCAT(__t, __LINE__)
558 #endif // _LIBCPP_HAS_NO_STATIC_ASSERT
560 #ifdef _LIBCPP_HAS_NO_DECLTYPE
561 #define decltype(x) __typeof__(x)
564 #ifdef _LIBCPP_HAS_NO_CONSTEXPR
565 #define _LIBCPP_CONSTEXPR
567 #define _LIBCPP_CONSTEXPR constexpr
570 #ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
571 #define _LIBCPP_DEFAULT {}
573 #define _LIBCPP_DEFAULT = default;
577 #define _NOALIAS __attribute__((__malloc__))
582 #ifndef __has_feature
583 #define __has_feature(__x) 0
586 #ifndef __has_builtin
587 #define __has_builtin(__x) 0
590 #if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__)
591 # define _LIBCPP_EXPLICIT explicit
593 # define _LIBCPP_EXPLICIT
596 #if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete)
597 # define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
600 #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
601 #define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
602 #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
604 _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
605 _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
606 _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
608 #else // _LIBCPP_HAS_NO_STRONG_ENUMS
609 #define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x
610 #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
611 #endif // _LIBCPP_HAS_NO_STRONG_ENUMS
614 # if _LIBCPP_DEBUG == 0
615 # define _LIBCPP_DEBUG_LEVEL 1
616 # elif _LIBCPP_DEBUG == 1
617 # define _LIBCPP_DEBUG_LEVEL 2
619 # error Supported values for _LIBCPP_DEBUG are 0 and 1
621 # define _LIBCPP_EXTERN_TEMPLATE(...)
624 #ifndef _LIBCPP_EXTERN_TEMPLATE
625 #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
628 #ifndef _LIBCPP_EXTERN_TEMPLATE2
629 #define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__;
632 #if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__)
633 #define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63)
636 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__)
637 #define _LIBCPP_LOCALE__L_EXTENSIONS 1
641 #define _DECLARE_C99_LDBL_MATH 1
644 #if defined(__APPLE__) || defined(__FreeBSD__)
645 #define _LIBCPP_HAS_DEFAULTRUNELOCALE
648 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
649 #define _LIBCPP_WCTYPE_IS_MASK
653 #define _LIBCPP_ELAST ELAST
654 #elif defined(__linux__)
655 #define _LIBCPP_ELAST 4095
656 #elif defined(_NEWLIB_VERSION)
657 #define _LIBCPP_ELAST __ELASTERROR
658 #elif defined(__APPLE__)
659 // Not _LIBCPP_ELAST needed on Apple
660 #elif defined(__sun__)
661 #define _LIBCPP_ELAST ESTALE
663 // Warn here so that the person doing the libcxx port has an easier time:
664 #warning This platform's ELAST hasn't been ported yet
667 #ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
668 # if defined(__FreeBSD__)
669 // Making the std::pair copy constructor trivial breaks ABI compatibility with
670 // earlier versions of libc++ shipped by FreeBSD, so turn it off by default.
671 // See also http://svnweb.freebsd.org/changeset/base/261801
672 # define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 0
674 # define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
678 #ifndef _LIBCPP_STD_VER
679 # if __cplusplus <= 201103L
680 # define _LIBCPP_STD_VER 11
681 # elif __cplusplus <= 201402L
682 # define _LIBCPP_STD_VER 14
684 # define _LIBCPP_STD_VER 15 // current year, or date of c++17 ratification
686 #endif // _LIBCPP_STD_VER
688 #if _LIBCPP_STD_VER > 11
689 #define _LIBCPP_DEPRECATED [[deprecated]]
691 #define _LIBCPP_DEPRECATED
694 #if _LIBCPP_STD_VER <= 11
695 #define _LIBCPP_EXPLICIT_AFTER_CXX11
696 #define _LIBCPP_DEPRECATED_AFTER_CXX11
698 #define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
699 #define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]]
702 #if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
703 #define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
705 #define _LIBCPP_CONSTEXPR_AFTER_CXX11
708 #ifndef _LIBCPP_HAS_NO_ASAN
709 extern "C" void __sanitizer_annotate_contiguous_container(
710 const void *, const void *, const void *, const void *);
713 // Try to find out if RTTI is disabled.
714 // g++ and cl.exe have RTTI on by default and define a macro when it is.
715 // g++ only defines the macro in 4.3.2 and onwards.
716 #if !defined(_LIBCPP_NO_RTTI)
717 # if defined(__GNUG__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \
718 (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI)
719 # define _LIBCPP_NO_RTTI
720 # elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI)
721 # define _LIBCPP_NO_RTTI
726 # define _LIBCPP_WEAK __attribute__((__weak__))
729 #if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS)
730 # error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \
731 _LIBCPP_HAS_NO_THREADS is defined.
734 #endif // _LIBCPP_CONFIG