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 #define _LIBCPP_VERSION 3800
26 #define _LIBCPP_ABI_VERSION 1
28 #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
29 #define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y)
31 #define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)
34 #ifndef __has_attribute
35 #define __has_attribute(__x) 0
38 #define __has_builtin(__x) 0
40 #ifndef __has_extension
41 #define __has_extension(__x) 0
44 #define __has_feature(__x) 0
46 // '__is_identifier' returns '0' if '__x' is a reserved identifier provided by
47 // the compiler and '1' otherwise.
48 #ifndef __is_identifier
49 #define __is_identifier(__x) 1
53 #ifdef __LITTLE_ENDIAN__
55 #define _LIBCPP_LITTLE_ENDIAN 1
56 #define _LIBCPP_BIG_ENDIAN 0
57 #endif // __LITTLE_ENDIAN__
58 #endif // __LITTLE_ENDIAN__
62 #define _LIBCPP_LITTLE_ENDIAN 0
63 #define _LIBCPP_BIG_ENDIAN 1
64 #endif // __BIG_ENDIAN__
65 #endif // __BIG_ENDIAN__
68 # include <sys/endian.h>
69 # if _BYTE_ORDER == _LITTLE_ENDIAN
70 # define _LIBCPP_LITTLE_ENDIAN 1
71 # define _LIBCPP_BIG_ENDIAN 0
72 # else // _BYTE_ORDER == _LITTLE_ENDIAN
73 # define _LIBCPP_LITTLE_ENDIAN 0
74 # define _LIBCPP_BIG_ENDIAN 1
75 # endif // _BYTE_ORDER == _LITTLE_ENDIAN
76 # ifndef __LONG_LONG_SUPPORTED
77 # define _LIBCPP_HAS_NO_LONG_LONG
78 # endif // __LONG_LONG_SUPPORTED
81 #if defined(__NetBSD__) || defined(__minix)
82 # include <sys/endian.h>
83 # if _BYTE_ORDER == _LITTLE_ENDIAN
84 # define _LIBCPP_LITTLE_ENDIAN 1
85 # define _LIBCPP_BIG_ENDIAN 0
86 # else // _BYTE_ORDER == _LITTLE_ENDIAN
87 # define _LIBCPP_LITTLE_ENDIAN 0
88 # define _LIBCPP_BIG_ENDIAN 1
89 # endif // _BYTE_ORDER == _LITTLE_ENDIAN
90 # define _LIBCPP_HAS_QUICK_EXIT
94 # define _LIBCPP_HAS_NO_THREADS 1
95 #endif // defined(__minix)
98 # define _LIBCPP_LITTLE_ENDIAN 1
99 # define _LIBCPP_BIG_ENDIAN 0
100 // Compiler intrinsics (MSVC)
101 #if defined(_MSC_VER) && _MSC_VER >= 1400
102 # define _LIBCPP_HAS_IS_BASE_OF
104 # if defined(_MSC_VER) && !defined(__clang__)
105 # define _LIBCPP_MSVC // Using Microsoft Visual C++ compiler
106 # define _LIBCPP_TOSTRING2(x) #x
107 # define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
108 # define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x))
110 # // If mingw not explicitly detected, assume using MS C runtime only.
112 # define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
117 # include <sys/isa_defs.h>
118 # ifdef _LITTLE_ENDIAN
119 # define _LIBCPP_LITTLE_ENDIAN 1
120 # define _LIBCPP_BIG_ENDIAN 0
122 # define _LIBCPP_LITTLE_ENDIAN 0
123 # define _LIBCPP_BIG_ENDIAN 1
127 #if defined(__CloudABI__)
128 // Certain architectures provide arc4random(). Prefer using
129 // arc4random() over /dev/{u,}random to make it possible to obtain
130 // random data even when using sandboxing mechanisms such as chroots,
132 # define _LIBCPP_USING_ARC4_RANDOM
133 #elif defined(__native_client__)
134 // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
135 // including accesses to the special files under /dev. C++11's
136 // std::random_device is instead exposed through a NaCl syscall.
137 # define _LIBCPP_USING_NACL_RANDOM
138 #elif defined(_WIN32)
139 # define _LIBCPP_USING_WIN32_RANDOM
141 # define _LIBCPP_USING_DEV_RANDOM
144 #if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
146 # if __BYTE_ORDER == __LITTLE_ENDIAN
147 # define _LIBCPP_LITTLE_ENDIAN 1
148 # define _LIBCPP_BIG_ENDIAN 0
149 # elif __BYTE_ORDER == __BIG_ENDIAN
150 # define _LIBCPP_LITTLE_ENDIAN 0
151 # define _LIBCPP_BIG_ENDIAN 1
152 # else // __BYTE_ORDER == __BIG_ENDIAN
153 # error unable to determine endian
155 #endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
159 // only really useful for a DLL
160 #ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally...
162 # define _LIBCPP_HIDDEN
163 # define _LIBCPP_FUNC_VIS __declspec(dllexport)
164 # define _LIBCPP_TYPE_VIS __declspec(dllexport)
166 # define _LIBCPP_HIDDEN
167 # define _LIBCPP_FUNC_VIS __declspec(dllimport)
168 # define _LIBCPP_TYPE_VIS __declspec(dllimport)
171 # define _LIBCPP_HIDDEN
172 # define _LIBCPP_FUNC_VIS
173 # define _LIBCPP_TYPE_VIS
176 #define _LIBCPP_TYPE_VIS_ONLY
177 #define _LIBCPP_FUNC_VIS_ONLY
179 #ifndef _LIBCPP_INLINE_VISIBILITY
181 # define _LIBCPP_INLINE_VISIBILITY __forceinline
182 # else // MinGW GCC and Clang
183 # define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
187 #ifndef _LIBCPP_EXCEPTION_ABI
188 #define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
191 #ifndef _LIBCPP_ALWAYS_INLINE
193 # define _LIBCPP_ALWAYS_INLINE __forceinline
199 #ifndef _LIBCPP_HIDDEN
200 #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
203 #ifndef _LIBCPP_FUNC_VIS
204 #define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
207 #ifndef _LIBCPP_TYPE_VIS
208 # if __has_attribute(__type_visibility__)
209 # define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
211 # define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
215 #ifndef _LIBCPP_TYPE_VIS_ONLY
216 # define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS
219 #ifndef _LIBCPP_FUNC_VIS_ONLY
220 # define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS
223 #ifndef _LIBCPP_INLINE_VISIBILITY
224 #define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
227 #ifndef _LIBCPP_EXCEPTION_ABI
228 #define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
231 #ifndef _LIBCPP_ALWAYS_INLINE
232 #define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
235 #if defined(__clang__)
237 #if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && \
239 #define _LIBCPP_ALTERNATE_STRING_LAYOUT
242 #if __has_feature(cxx_alignas)
243 # define _ALIGNAS_TYPE(x) alignas(x)
244 # define _ALIGNAS(x) alignas(x)
246 # define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
247 # define _ALIGNAS(x) __attribute__((__aligned__(x)))
250 #if !__has_feature(cxx_alias_templates)
251 #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
254 #if __cplusplus < 201103L
255 typedef __char16_t char16_t;
256 typedef __char32_t char32_t;
259 #if !(__has_feature(cxx_exceptions))
260 #define _LIBCPP_NO_EXCEPTIONS
263 #if !(__has_feature(cxx_rtti))
264 #define _LIBCPP_NO_RTTI
267 #if !(__has_feature(cxx_strong_enums))
268 #define _LIBCPP_HAS_NO_STRONG_ENUMS
271 #if !(__has_feature(cxx_decltype))
272 #define _LIBCPP_HAS_NO_DECLTYPE
275 #if __has_feature(cxx_attributes)
276 # define _LIBCPP_NORETURN [[noreturn]]
278 # define _LIBCPP_NORETURN __attribute__ ((noreturn))
281 #define _LIBCPP_UNUSED __attribute__((__unused__))
283 #if !(__has_feature(cxx_defaulted_functions))
284 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
285 #endif // !(__has_feature(cxx_defaulted_functions))
287 #if !(__has_feature(cxx_deleted_functions))
288 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
289 #endif // !(__has_feature(cxx_deleted_functions))
291 #if !(__has_feature(cxx_lambdas))
292 #define _LIBCPP_HAS_NO_LAMBDAS
295 #if !(__has_feature(cxx_nullptr))
296 #define _LIBCPP_HAS_NO_NULLPTR
299 #if !(__has_feature(cxx_rvalue_references))
300 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
303 #if !(__has_feature(cxx_static_assert))
304 #define _LIBCPP_HAS_NO_STATIC_ASSERT
307 #if !(__has_feature(cxx_auto_type))
308 #define _LIBCPP_HAS_NO_AUTO_TYPE
311 #if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return)
312 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
315 #if !(__has_feature(cxx_variadic_templates))
316 #define _LIBCPP_HAS_NO_VARIADICS
319 #if !(__has_feature(cxx_trailing_return))
320 #define _LIBCPP_HAS_NO_TRAILING_RETURN
323 #if !(__has_feature(cxx_generalized_initializers))
324 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
327 #if __has_feature(is_base_of)
328 # define _LIBCPP_HAS_IS_BASE_OF
331 #if __has_feature(is_final)
332 # define _LIBCPP_HAS_IS_FINAL
335 // Objective-C++ features (opt-in)
336 #if __has_feature(objc_arc)
337 #define _LIBCPP_HAS_OBJC_ARC
340 #if __has_feature(objc_arc_weak)
341 #define _LIBCPP_HAS_OBJC_ARC_WEAK
342 #define _LIBCPP_HAS_NO_STRONG_ENUMS
345 #if !(__has_feature(cxx_constexpr))
346 #define _LIBCPP_HAS_NO_CONSTEXPR
349 #if !(__has_feature(cxx_relaxed_constexpr))
350 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
353 #if !(__has_feature(cxx_variable_templates))
354 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
357 #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
358 #if defined(__FreeBSD__)
359 #define _LIBCPP_HAS_QUICK_EXIT
360 #define _LIBCPP_HAS_C11_FEATURES
361 #elif defined(__ANDROID__)
362 #define _LIBCPP_HAS_QUICK_EXIT
363 #elif defined(__linux__)
364 #include <features.h>
365 #if __GLIBC_PREREQ(2, 15)
366 #define _LIBCPP_HAS_QUICK_EXIT
368 #if __GLIBC_PREREQ(2, 17)
369 #define _LIBCPP_HAS_C11_FEATURES
374 #if (__has_feature(cxx_noexcept))
375 # define _NOEXCEPT noexcept
376 # define _NOEXCEPT_(x) noexcept(x)
377 # define _NOEXCEPT_OR_FALSE(x) noexcept(x)
379 # define _NOEXCEPT throw()
380 # define _NOEXCEPT_(x)
381 # define _NOEXCEPT_OR_FALSE(x) false
384 #if __has_feature(underlying_type)
385 # define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
388 #if __has_feature(is_literal)
389 # define _LIBCPP_IS_LITERAL(T) __is_literal(T)
392 // Inline namespaces are available in Clang regardless of C++ dialect.
393 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
394 #define _LIBCPP_END_NAMESPACE_STD } }
395 #define _VSTD std::_LIBCPP_NAMESPACE
398 inline namespace _LIBCPP_NAMESPACE {
402 #if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer)
403 #define _LIBCPP_HAS_NO_ASAN
406 #elif defined(__GNUC__)
408 #define _ALIGNAS(x) __attribute__((__aligned__(x)))
409 #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
411 #define _LIBCPP_NORETURN __attribute__((noreturn))
413 #define _LIBCPP_UNUSED __attribute__((__unused__))
416 #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T)
417 #define _LIBCPP_IS_LITERAL(T) __is_literal_type(T)
418 #define _LIBCPP_HAS_IS_FINAL
421 #if defined(__GNUC__) && _GNUC_VER >= 403
422 # define _LIBCPP_HAS_IS_BASE_OF
426 #define _LIBCPP_NO_EXCEPTIONS
429 #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
431 // constexpr was added to GCC in 4.6.
433 #define _LIBCPP_HAS_NO_CONSTEXPR
434 // Can only use constexpr in c++11 mode.
435 #elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
436 #define _LIBCPP_HAS_NO_CONSTEXPR
439 // No version of GCC supports relaxed constexpr rules
440 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
441 // GCC 5 will support variable templates
442 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
444 #define _NOEXCEPT throw()
445 #define _NOEXCEPT_(x)
446 #define _NOEXCEPT_OR_FALSE(x) false
448 #ifndef __GXX_EXPERIMENTAL_CXX0X__
450 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
451 #define _LIBCPP_HAS_NO_DECLTYPE
452 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
453 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
454 #define _LIBCPP_HAS_NO_NULLPTR
455 #define _LIBCPP_HAS_NO_STATIC_ASSERT
456 #define _LIBCPP_HAS_NO_UNICODE_CHARS
457 #define _LIBCPP_HAS_NO_VARIADICS
458 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
459 #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
460 #define _LIBCPP_HAS_NO_STRONG_ENUMS
462 #else // __GXX_EXPERIMENTAL_CXX0X__
464 #define _LIBCPP_HAS_NO_TRAILING_RETURN
465 #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
468 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES
472 #define _LIBCPP_HAS_NO_STATIC_ASSERT
476 #define _LIBCPP_HAS_NO_DECLTYPE
477 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
478 #define _LIBCPP_HAS_NO_UNICODE_CHARS
479 #define _LIBCPP_HAS_NO_VARIADICS
480 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
481 #endif // _GNUC_VER < 404
484 #define _LIBCPP_HAS_NO_NULLPTR
488 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
489 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
492 #endif // __GXX_EXPERIMENTAL_CXX0X__
494 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE {
495 #define _LIBCPP_END_NAMESPACE_STD } }
496 #define _VSTD std::_LIBCPP_NAMESPACE
499 namespace _LIBCPP_NAMESPACE {
501 using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
504 #if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__)
505 #define _LIBCPP_HAS_NO_ASAN
508 #elif defined(_LIBCPP_MSVC)
510 #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
511 #define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
512 #define _LIBCPP_HAS_NO_CONSTEXPR
513 #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
514 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
515 #define _LIBCPP_HAS_NO_UNICODE_CHARS
516 #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
517 #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
518 #define __alignof__ __alignof
519 #define _LIBCPP_NORETURN __declspec(noreturn)
520 #define _LIBCPP_UNUSED
521 #define _ALIGNAS(x) __declspec(align(x))
522 #define _LIBCPP_HAS_NO_VARIADICS
524 #define _NOEXCEPT throw ()
525 #define _NOEXCEPT_(x)
526 #define _NOEXCEPT_OR_FALSE(x) false
528 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
529 #define _LIBCPP_END_NAMESPACE_STD }
532 # define _LIBCPP_WEAK
536 #define _LIBCPP_HAS_NO_ASAN
538 #elif defined(__IBMCPP__)
540 #define _ALIGNAS(x) __attribute__((__aligned__(x)))
541 #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
542 #define _ATTRIBUTE(x) __attribute__((x))
543 #define _LIBCPP_NORETURN __attribute__((noreturn))
544 #define _LIBCPP_UNUSED
546 #define _NOEXCEPT throw()
547 #define _NOEXCEPT_(x)
548 #define _NOEXCEPT_OR_FALSE(x) false
550 #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
551 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE
552 #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
553 #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
554 #define _LIBCPP_HAS_NO_NULLPTR
555 #define _LIBCPP_HAS_NO_UNICODE_CHARS
556 #define _LIBCPP_HAS_IS_BASE_OF
557 #define _LIBCPP_HAS_IS_FINAL
558 #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
561 #define __MULTILOCALE_API
564 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
565 #define _LIBCPP_END_NAMESPACE_STD } }
566 #define _VSTD std::_LIBCPP_NAMESPACE
569 inline namespace _LIBCPP_NAMESPACE {
573 #define _LIBCPP_HAS_NO_ASAN
575 #endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__
577 #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
578 typedef unsigned short char16_t;
579 typedef unsigned int char32_t;
580 #endif // _LIBCPP_HAS_NO_UNICODE_CHARS
582 #ifndef __SIZEOF_INT128__
583 #define _LIBCPP_HAS_NO_INT128
586 #ifdef _LIBCPP_HAS_NO_STATIC_ASSERT
588 template <bool> struct __static_assert_test;
589 template <> struct __static_assert_test<true> {};
590 template <unsigned> struct __static_assert_check {};
591 #define static_assert(__b, __m) \
592 typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
593 _LIBCPP_CONCAT(__t, __LINE__)
595 #endif // _LIBCPP_HAS_NO_STATIC_ASSERT
597 #ifdef _LIBCPP_HAS_NO_DECLTYPE
598 // GCC 4.6 provides __decltype in all standard modes.
599 #if !__is_identifier(__decltype) || _GNUC_VER >= 406
600 # define decltype(__x) __decltype(__x)
602 # define decltype(__x) __typeof__(__x)
606 #ifdef _LIBCPP_HAS_NO_CONSTEXPR
607 #define _LIBCPP_CONSTEXPR
609 #define _LIBCPP_CONSTEXPR constexpr
612 #ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
613 #define _LIBCPP_DEFAULT {}
615 #define _LIBCPP_DEFAULT = default;
619 #define _NOALIAS __attribute__((__malloc__))
624 #if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__)
625 # define _LIBCPP_EXPLICIT explicit
627 # define _LIBCPP_EXPLICIT
630 #if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete)
631 # define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
634 #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
635 #define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
636 #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
638 _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
639 _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
640 _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
642 #else // _LIBCPP_HAS_NO_STRONG_ENUMS
643 #define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x
644 #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
645 #endif // _LIBCPP_HAS_NO_STRONG_ENUMS
648 # if _LIBCPP_DEBUG == 0
649 # define _LIBCPP_DEBUG_LEVEL 1
650 # elif _LIBCPP_DEBUG == 1
651 # define _LIBCPP_DEBUG_LEVEL 2
653 # error Supported values for _LIBCPP_DEBUG are 0 and 1
655 # define _LIBCPP_EXTERN_TEMPLATE(...)
658 #ifndef _LIBCPP_EXTERN_TEMPLATE
659 #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
662 #ifndef _LIBCPP_EXTERN_TEMPLATE2
663 #define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__;
666 #if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__)
667 #define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63)
670 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || \
671 defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__) || defined(__minix)
672 #define _LIBCPP_LOCALE__L_EXTENSIONS 1
675 #if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) && \
676 !defined(__CloudABI__)
677 #define _LIBCPP_HAS_CATOPEN 1
681 #define _DECLARE_C99_LDBL_MATH 1
684 #if defined(__APPLE__) || defined(__FreeBSD__)
685 #define _LIBCPP_HAS_DEFAULTRUNELOCALE
688 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
689 #define _LIBCPP_WCTYPE_IS_MASK
692 #ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
693 # define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
696 #ifndef _LIBCPP_STD_VER
697 # if __cplusplus <= 201103L
698 # define _LIBCPP_STD_VER 11
699 # elif __cplusplus <= 201402L
700 # define _LIBCPP_STD_VER 14
702 # define _LIBCPP_STD_VER 15 // current year, or date of c++17 ratification
704 #endif // _LIBCPP_STD_VER
706 #if _LIBCPP_STD_VER > 11
707 #define _LIBCPP_DEPRECATED [[deprecated]]
709 #define _LIBCPP_DEPRECATED
712 #if _LIBCPP_STD_VER <= 11
713 #define _LIBCPP_EXPLICIT_AFTER_CXX11
714 #define _LIBCPP_DEPRECATED_AFTER_CXX11
716 #define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
717 #define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]]
720 #if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
721 #define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
723 #define _LIBCPP_CONSTEXPR_AFTER_CXX11
726 #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
727 # define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x)
729 # define _LIBCPP_EXPLICIT_MOVE(x) (x)
732 #ifndef _LIBCPP_HAS_NO_ASAN
733 extern "C" void __sanitizer_annotate_contiguous_container(
734 const void *, const void *, const void *, const void *);
737 // Try to find out if RTTI is disabled.
738 // g++ and cl.exe have RTTI on by default and define a macro when it is.
739 // g++ only defines the macro in 4.3.2 and onwards.
740 #if !defined(_LIBCPP_NO_RTTI)
741 # if defined(__GNUG__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \
742 (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI)
743 # define _LIBCPP_NO_RTTI
744 # elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI)
745 # define _LIBCPP_NO_RTTI
750 # define _LIBCPP_WEAK __attribute__((__weak__))
753 #if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS)
754 # error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \
755 _LIBCPP_HAS_NO_THREADS is defined.
758 // Systems that use capability-based security (FreeBSD with Capsicum,
759 // Nuxi CloudABI) may only provide local filesystem access (using *at()).
760 // Functions like open(), rename(), unlink() and stat() should not be
761 // used, as they attempt to access the global filesystem namespace.
763 #define _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
766 // CloudABI is intended for running networked services. Processes do not
767 // have standard input and output channels.
769 #define _LIBCPP_HAS_NO_STDIN
770 #define _LIBCPP_HAS_NO_STDOUT
773 #if defined(__ANDROID__) || defined(__CloudABI__)
774 #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
777 // Thread-unsafe functions such as strtok(), mbtowc() and localtime()
778 // are not available.
780 #define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
783 #if __has_extension(c_atomic)
784 #define _LIBCPP_HAS_C_ATOMIC_IMP
785 #elif _GNUC_VER > 407
786 #define _LIBCPP_HAS_GCC_ATOMIC_IMP
789 #if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \
790 || defined(_LIBCPP_HAS_NO_THREADS)
791 #define _LIBCPP_HAS_NO_ATOMIC_HEADER
794 #endif // _LIBCPP_CONFIG