17
17
18
18
#ifdef __GNUC__
19
19
#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
20
+ #else
21
+ #define _GNUC_VER 0
20
22
#endif
21
23
22
- #define _LIBCPP_VERSION 1101
24
+ #define _LIBCPP_VERSION 3800
23
25
24
26
#define _LIBCPP_ABI_VERSION 1
25
27
28
30
29
31
#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT (__,_LIBCPP_ABI_VERSION)
30
32
33
+
34
+ #ifndef __has_attribute
35
+ #define __has_attribute (__x ) 0
36
+ #endif
37
+ #ifndef __has_builtin
38
+ #define __has_builtin (__x ) 0
39
+ #endif
40
+ #ifndef __has_extension
41
+ #define __has_extension (__x ) 0
42
+ #endif
43
+ #ifndef __has_feature
44
+ #define __has_feature (__x ) 0
45
+ #endif
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
50
+ #endif
51
+
52
+
31
53
#ifdef __LITTLE_ENDIAN__
32
54
#if __LITTLE_ENDIAN__
33
55
#define _LIBCPP_LITTLE_ENDIAN 1
71
93
#ifdef _WIN32
72
94
# define _LIBCPP_LITTLE_ENDIAN 1
73
95
# define _LIBCPP_BIG_ENDIAN 0
74
- // Compiler intrinsics (GCC or MSVC)
75
- # if defined(__clang__) \
76
- || (defined(_MSC_VER) && _MSC_VER >= 1400 ) \
77
- || (defined(__GNUC__) && _GNUC_VER > 403 )
96
+ // Compiler intrinsics (MSVC)
97
+ #if defined(_MSC_VER) && _MSC_VER >= 1400
78
98
# define _LIBCPP_HAS_IS_BASE_OF
79
99
# endif
80
100
# if defined(_MSC_VER) && !defined(__clang__)
89
109
# endif
90
110
#endif // _WIN32
91
111
92
- #ifdef __linux__
93
- # if defined(__GNUC__) && _GNUC_VER >= 403
94
- # define _LIBCPP_HAS_IS_BASE_OF
95
- # endif
96
- #endif
97
-
98
112
#ifdef __sun__
99
113
# include < sys/isa_defs.h>
100
114
# ifdef _LITTLE_ENDIAN
106
120
# endif
107
121
#endif // __sun__
108
122
123
+ #if defined(__CloudABI__)
124
+ // Certain architectures provide arc4random(). Prefer using
125
+ // arc4random() over /dev/{u,}random to make it possible to obtain
126
+ // random data even when using sandboxing mechanisms such as chroots,
127
+ // Capsicum, etc.
128
+ # define _LIBCPP_USING_ARC4_RANDOM
129
+ #elif defined(__native_client__)
130
+ // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
131
+ // including accesses to the special files under /dev. C++11's
132
+ // std::random_device is instead exposed through a NaCl syscall.
133
+ # define _LIBCPP_USING_NACL_RANDOM
134
+ #elif defined(_WIN32)
135
+ # define _LIBCPP_USING_WIN32_RANDOM
136
+ #else
137
+ # define _LIBCPP_USING_DEV_RANDOM
138
+ #endif
139
+
109
140
#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
110
141
# include < endian.h>
111
142
# if __BYTE_ORDER == __LITTLE_ENDIAN
161
192
162
193
#endif // _WIN32
163
194
164
- #ifndef __has_attribute
165
- #define __has_attribute (__x ) 0
166
- #endif
167
-
168
195
#ifndef _LIBCPP_HIDDEN
169
196
#define _LIBCPP_HIDDEN __attribute__ ((__visibility__(" hidden" )))
170
197
#endif
221
248
#endif
222
249
223
250
#if __cplusplus < 201103L
224
- #ifdef __linux__
225
- #define _LIBCPP_HAS_NO_UNICODE_CHARS
226
- #else
227
251
typedef __char16_t char16_t ;
228
252
typedef __char32_t char32_t ;
229
253
#endif
230
- #endif
231
254
232
255
#if !(__has_feature(cxx_exceptions))
233
256
#define _LIBCPP_NO_EXCEPTIONS
@@ -251,6 +274,8 @@ typedef __char32_t char32_t;
251
274
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
252
275
#endif
253
276
277
+ #define _LIBCPP_UNUSED __attribute__ ((__unused__))
278
+
254
279
#if !(__has_feature(cxx_defaulted_functions))
255
280
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
256
281
#endif // !(__has_feature(cxx_defaulted_functions))
@@ -299,6 +324,10 @@ typedef __char32_t char32_t;
299
324
# define _LIBCPP_HAS_IS_BASE_OF
300
325
#endif
301
326
327
+ #if __has_feature(is_final)
328
+ # define _LIBCPP_HAS_IS_FINAL
329
+ #endif
330
+
302
331
// Objective-C++ features (opt-in)
303
332
#if __has_feature(objc_arc)
304
333
#define _LIBCPP_HAS_OBJC_ARC
@@ -317,6 +346,10 @@ typedef __char32_t char32_t;
317
346
#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
318
347
#endif
319
348
349
+ #if !(__has_feature(cxx_variable_templates))
350
+ #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
351
+ #endif
352
+
320
353
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
321
354
#if defined(__FreeBSD__)
322
355
#define _LIBCPP_HAS_QUICK_EXIT
@@ -373,9 +406,16 @@ namespace std {
373
406
374
407
#define _LIBCPP_NORETURN __attribute__ ((noreturn))
375
408
409
+ #define _LIBCPP_UNUSED __attribute__ ((__unused__))
410
+
376
411
#if _GNUC_VER >= 407
377
412
#define _LIBCPP_UNDERLYING_TYPE (T ) __underlying_type(T)
378
413
#define _LIBCPP_IS_LITERAL (T ) __is_literal_type(T)
414
+ #define _LIBCPP_HAS_IS_FINAL
415
+ #endif
416
+
417
+ #if defined(__GNUC__) && _GNUC_VER >= 403
418
+ # define _LIBCPP_HAS_IS_BASE_OF
379
419
#endif
380
420
381
421
#if !__EXCEPTIONS
@@ -394,6 +434,8 @@ namespace std {
394
434
395
435
// No version of GCC supports relaxed constexpr rules
396
436
#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
437
+ // GCC 5 will support variable templates
438
+ #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
397
439
398
440
#define _NOEXCEPT throw ()
399
441
#define _NOEXCEPT_ (x )
@@ -465,11 +507,13 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
465
507
#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
466
508
#define _LIBCPP_HAS_NO_CONSTEXPR
467
509
#define _LIBCPP_HAS_NO_CXX14_CONSTEXPR
510
+ #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
468
511
#define _LIBCPP_HAS_NO_UNICODE_CHARS
469
512
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
470
513
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
471
514
#define __alignof__ __alignof
472
515
#define _LIBCPP_NORETURN __declspec (noreturn)
516
+ #define _LIBCPP_UNUSED
473
517
#define _ALIGNAS (x ) __declspec(align(x))
474
518
#define _LIBCPP_HAS_NO_VARIADICS
475
519
@@ -493,6 +537,7 @@ namespace std {
493
537
#define _ALIGNAS_TYPE (x ) __attribute__((__aligned__(__alignof(x))))
494
538
#define _ATTRIBUTE (x ) __attribute__((x))
495
539
#define _LIBCPP_NORETURN __attribute__ ((noreturn))
540
+ #define _LIBCPP_UNUSED
496
541
497
542
#define _NOEXCEPT throw ()
498
543
#define _NOEXCEPT_ (x )
@@ -505,6 +550,8 @@ namespace std {
505
550
#define _LIBCPP_HAS_NO_NULLPTR
506
551
#define _LIBCPP_HAS_NO_UNICODE_CHARS
507
552
#define _LIBCPP_HAS_IS_BASE_OF
553
+ #define _LIBCPP_HAS_IS_FINAL
554
+ #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES
508
555
509
556
#if defined(_AIX)
510
557
#define __MULTILOCALE_API
@@ -544,7 +591,12 @@ template <unsigned> struct __static_assert_check {};
544
591
#endif // _LIBCPP_HAS_NO_STATIC_ASSERT
545
592
546
593
#ifdef _LIBCPP_HAS_NO_DECLTYPE
547
- #define decltype (x ) __typeof__(x)
594
+ // GCC 4.6 provides __decltype in all standard modes.
595
+ #if !__is_identifier(__decltype) || _GNUC_VER >= 406
596
+ # define decltype (__x ) __decltype(__x)
597
+ #else
598
+ # define decltype (__x ) __typeof__(__x)
599
+ #endif
548
600
#endif
549
601
550
602
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
@@ -565,14 +617,6 @@ template <unsigned> struct __static_assert_check {};
565
617
#define _NOALIAS
566
618
#endif
567
619
568
- #ifndef __has_feature
569
- #define __has_feature (__x ) 0
570
- #endif
571
-
572
- #ifndef __has_builtin
573
- #define __has_builtin (__x ) 0
574
- #endif
575
-
576
620
#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__)
577
621
# define _LIBCPP_EXPLICIT explicit
578
622
#else
@@ -608,7 +652,7 @@ template <unsigned> struct __static_assert_check {};
608
652
#endif
609
653
610
654
#ifndef _LIBCPP_EXTERN_TEMPLATE
611
- #define _LIBCPP_EXTERN_TEMPLATE (...)
655
+ #define _LIBCPP_EXTERN_TEMPLATE (...) extern template __VA_ARGS__;
612
656
#endif
613
657
614
658
#ifndef _LIBCPP_EXTERN_TEMPLATE2
@@ -619,10 +663,16 @@ template <unsigned> struct __static_assert_check {};
619
663
#define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63 )
620
664
#endif
621
665
622
- #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__)
666
+ #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || \
667
+ defined (__sun__) || defined(__NetBSD__) || defined(__CloudABI__)
623
668
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
624
669
#endif
625
670
671
+ #if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) && \
672
+ !defined(__CloudABI__)
673
+ #define _LIBCPP_HAS_CATOPEN 1
674
+ #endif
675
+
626
676
#ifdef __FreeBSD__
627
677
#define _DECLARE_C99_LDBL_MATH 1
628
678
#endif
@@ -669,6 +719,12 @@ template <unsigned> struct __static_assert_check {};
669
719
#define _LIBCPP_CONSTEXPR_AFTER_CXX11
670
720
#endif
671
721
722
+ #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
723
+ # define _LIBCPP_EXPLICIT_MOVE (x ) _VSTD::move(x)
724
+ #else
725
+ # define _LIBCPP_EXPLICIT_MOVE (x ) (x)
726
+ #endif
727
+
672
728
#ifndef _LIBCPP_HAS_NO_ASAN
673
729
extern " C" void __sanitizer_annotate_contiguous_container (
674
730
const void *, const void *, const void *, const void *);
@@ -678,8 +734,8 @@ extern "C" void __sanitizer_annotate_contiguous_container(
678
734
// g++ and cl.exe have RTTI on by default and define a macro when it is.
679
735
// g++ only defines the macro in 4.3.2 and onwards.
680
736
#if !defined(_LIBCPP_NO_RTTI)
681
- # if defined(__GNUG__) && (__GNUC__ >= 4 && \
682
- (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2 )) && !defined(__GXX_RTTI)
737
+ # if defined(__GNUG__) && (( __GNUC__ >= 5) || (__GNUC__ = = 4 && \
738
+ (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2 ))) && !defined(__GXX_RTTI)
683
739
# define _LIBCPP_NO_RTTI
684
740
# elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI)
685
741
# define _LIBCPP_NO_RTTI
@@ -690,4 +746,45 @@ extern "C" void __sanitizer_annotate_contiguous_container(
690
746
# define _LIBCPP_WEAK __attribute__ ((__weak__))
691
747
#endif
692
748
693
- #endif // _LIBCPP_CONFIG
749
+ #if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS)
750
+ # error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \
751
+ _LIBCPP_HAS_NO_THREADS is defined.
752
+ #endif
753
+
754
+ // Systems that use capability-based security (FreeBSD with Capsicum,
755
+ // Nuxi CloudABI) may only provide local filesystem access (using *at()).
756
+ // Functions like open(), rename(), unlink() and stat() should not be
757
+ // used, as they attempt to access the global filesystem namespace.
758
+ #ifdef __CloudABI__
759
+ #define _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
760
+ #endif
761
+
762
+ // CloudABI is intended for running networked services. Processes do not
763
+ // have standard input and output channels.
764
+ #ifdef __CloudABI__
765
+ #define _LIBCPP_HAS_NO_STDIN
766
+ #define _LIBCPP_HAS_NO_STDOUT
767
+ #endif
768
+
769
+ #if defined(__ANDROID__) || defined(__CloudABI__)
770
+ #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
771
+ #endif
772
+
773
+ // Thread-unsafe functions such as strtok(), mbtowc() and localtime()
774
+ // are not available.
775
+ #ifdef __CloudABI__
776
+ #define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
777
+ #endif
778
+
779
+ #if __has_extension(c_atomic)
780
+ #define _LIBCPP_HAS_C_ATOMIC_IMP
781
+ #elif _GNUC_VER > 407
782
+ #define _LIBCPP_HAS_GCC_ATOMIC_IMP
783
+ #endif
784
+
785
+ #if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \
786
+ || defined(_LIBCPP_HAS_NO_THREADS)
787
+ #define _LIBCPP_HAS_NO_ATOMIC_HEADER
788
+ #endif
789
+
790
+ #endif // _LIBCPP_CONFIG
0 commit comments