1// -*- C++ -*-
2//===--------------------------- __config ---------------------------------===//
3//
4//                     The LLVM Compiler Infrastructure
5//
6// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
8//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP_CONFIG
12#define _LIBCPP_CONFIG
13
14#if !defined(_MSC_VER) || defined(__clang__)
15#pragma GCC system_header
16#endif
17
18#ifdef __GNUC__
19#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
20#endif
21
22#define _LIBCPP_VERSION 1101
23
24#define _LIBCPP_ABI_VERSION 1
25
26#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
27#define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y)
28
29#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)
30
31#ifdef __LITTLE_ENDIAN__
32#if __LITTLE_ENDIAN__
33#define _LIBCPP_LITTLE_ENDIAN 1
34#define _LIBCPP_BIG_ENDIAN    0
35#endif  // __LITTLE_ENDIAN__
36#endif  // __LITTLE_ENDIAN__
37
38#ifdef __BIG_ENDIAN__
39#if __BIG_ENDIAN__
40#define _LIBCPP_LITTLE_ENDIAN 0
41#define _LIBCPP_BIG_ENDIAN    1
42#endif  // __BIG_ENDIAN__
43#endif  // __BIG_ENDIAN__
44
45#ifdef __FreeBSD__
46# include <sys/endian.h>
47#  if _BYTE_ORDER == _LITTLE_ENDIAN
48#   define _LIBCPP_LITTLE_ENDIAN 1
49#   define _LIBCPP_BIG_ENDIAN    0
50# else  // _BYTE_ORDER == _LITTLE_ENDIAN
51#   define _LIBCPP_LITTLE_ENDIAN 0
52#   define _LIBCPP_BIG_ENDIAN    1
53# endif  // _BYTE_ORDER == _LITTLE_ENDIAN
54# ifndef __LONG_LONG_SUPPORTED
55#  define _LIBCPP_HAS_NO_LONG_LONG
56# endif  // __LONG_LONG_SUPPORTED
57#endif  // __FreeBSD__
58
59#ifdef __NetBSD__
60# include <sys/endian.h>
61#  if _BYTE_ORDER == _LITTLE_ENDIAN
62#   define _LIBCPP_LITTLE_ENDIAN 1
63#   define _LIBCPP_BIG_ENDIAN    0
64# else  // _BYTE_ORDER == _LITTLE_ENDIAN
65#   define _LIBCPP_LITTLE_ENDIAN 0
66#   define _LIBCPP_BIG_ENDIAN    1
67# endif  // _BYTE_ORDER == _LITTLE_ENDIAN
68# define _LIBCPP_HAS_QUICK_EXIT
69#endif  // __NetBSD__
70
71#ifdef _WIN32
72#  define _LIBCPP_LITTLE_ENDIAN 1
73#  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)
78#    define _LIBCPP_HAS_IS_BASE_OF
79#  endif
80#  if defined(_MSC_VER) && !defined(__clang__)
81#    define _LIBCPP_MSVC // Using Microsoft Visual C++ compiler
82#    define _LIBCPP_TOSTRING2(x) #x
83#    define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x)
84#    define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x))
85#  endif
86#  // If mingw not explicitly detected, assume using MS C runtime only.
87#  ifndef __MINGW32__
88#    define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
89#  endif
90#endif  // _WIN32
91
92#ifdef __linux__
93#  if defined(__GNUC__) && _GNUC_VER >= 403
94#    define _LIBCPP_HAS_IS_BASE_OF
95#  endif
96#endif
97
98#ifdef __sun__
99# include <sys/isa_defs.h>
100# ifdef _LITTLE_ENDIAN
101#   define _LIBCPP_LITTLE_ENDIAN 1
102#   define _LIBCPP_BIG_ENDIAN    0
103# else
104#   define _LIBCPP_LITTLE_ENDIAN 0
105#   define _LIBCPP_BIG_ENDIAN    1
106# endif
107#endif // __sun__
108
109#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
110# include <endian.h>
111# if __BYTE_ORDER == __LITTLE_ENDIAN
112#  define _LIBCPP_LITTLE_ENDIAN 1
113#  define _LIBCPP_BIG_ENDIAN    0
114# elif __BYTE_ORDER == __BIG_ENDIAN
115#  define _LIBCPP_LITTLE_ENDIAN 0
116#  define _LIBCPP_BIG_ENDIAN    1
117# else  // __BYTE_ORDER == __BIG_ENDIAN
118#  error unable to determine endian
119# endif
120#endif  // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
121
122#ifdef _WIN32
123
124// only really useful for a DLL
125#ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally...
126# ifdef cxx_EXPORTS
127#  define _LIBCPP_HIDDEN
128#  define _LIBCPP_FUNC_VIS __declspec(dllexport)
129#  define _LIBCPP_TYPE_VIS __declspec(dllexport)
130# else
131#  define _LIBCPP_HIDDEN
132#  define _LIBCPP_FUNC_VIS __declspec(dllimport)
133#  define _LIBCPP_TYPE_VIS __declspec(dllimport)
134# endif
135#else
136# define _LIBCPP_HIDDEN
137# define _LIBCPP_FUNC_VIS
138# define _LIBCPP_TYPE_VIS
139#endif
140
141#define _LIBCPP_TYPE_VIS_ONLY
142#define _LIBCPP_FUNC_VIS_ONLY
143
144#ifndef _LIBCPP_INLINE_VISIBILITY
145# ifdef _LIBCPP_MSVC
146#  define _LIBCPP_INLINE_VISIBILITY __forceinline
147# else // MinGW GCC and Clang
148#  define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__))
149# endif
150#endif
151
152#ifndef _LIBCPP_EXCEPTION_ABI
153#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
154#endif
155
156#ifndef _LIBCPP_ALWAYS_INLINE
157# ifdef _LIBCPP_MSVC
158#  define _LIBCPP_ALWAYS_INLINE __forceinline
159# endif
160#endif
161
162#endif // _WIN32
163
164#ifndef __has_attribute
165#define __has_attribute(__x) 0
166#endif
167
168#ifndef _LIBCPP_HIDDEN
169#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
170#endif
171
172#ifndef _LIBCPP_FUNC_VIS
173#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
174#endif
175
176#ifndef _LIBCPP_TYPE_VIS
177#  if __has_attribute(__type_visibility__)
178#    define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
179#  else
180#    define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
181#  endif
182#endif
183
184#ifndef _LIBCPP_TYPE_VIS_ONLY
185# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS
186#endif
187
188#ifndef _LIBCPP_FUNC_VIS_ONLY
189# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS
190#endif
191
192#ifndef _LIBCPP_INLINE_VISIBILITY
193#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
194#endif
195
196#ifndef _LIBCPP_EXCEPTION_ABI
197#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
198#endif
199
200#ifndef _LIBCPP_ALWAYS_INLINE
201#define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__visibility__("hidden"), __always_inline__))
202#endif
203
204#if defined(__clang__)
205
206#if __has_feature(cxx_alignas)
207#  define _ALIGNAS_TYPE(x) alignas(x)
208#  define _ALIGNAS(x) alignas(x)
209#else
210#  define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
211#  define _ALIGNAS(x) __attribute__((__aligned__(x)))
212#endif
213
214#if !__has_feature(cxx_alias_templates)
215#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
216#endif
217
218#if __cplusplus < 201103L
219#ifdef __linux__
220#define _LIBCPP_HAS_NO_UNICODE_CHARS
221#else
222typedef __char16_t char16_t;
223typedef __char32_t char32_t;
224#endif
225#endif
226
227#if !(__has_feature(cxx_exceptions))
228#define _LIBCPP_NO_EXCEPTIONS
229#endif
230
231#if !(__has_feature(cxx_rtti))
232#define _LIBCPP_NO_RTTI
233#endif
234
235#if !(__has_feature(cxx_strong_enums))
236#define _LIBCPP_HAS_NO_STRONG_ENUMS
237#endif
238
239#if !(__has_feature(cxx_decltype))
240#define _LIBCPP_HAS_NO_DECLTYPE
241#endif
242
243#if __has_feature(cxx_attributes)
244#  define _LIBCPP_NORETURN [[noreturn]]
245#else
246#  define _LIBCPP_NORETURN __attribute__ ((noreturn))
247#endif
248
249#if !(__has_feature(cxx_defaulted_functions))
250#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
251#endif  // !(__has_feature(cxx_defaulted_functions))
252
253#if !(__has_feature(cxx_deleted_functions))
254#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
255#endif  // !(__has_feature(cxx_deleted_functions))
256
257#if !(__has_feature(cxx_lambdas))
258#define _LIBCPP_HAS_NO_LAMBDAS
259#endif
260
261#if !(__has_feature(cxx_nullptr))
262#define _LIBCPP_HAS_NO_NULLPTR
263#endif
264
265#if !(__has_feature(cxx_rvalue_references))
266#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
267#endif
268
269#if !(__has_feature(cxx_static_assert))
270#define _LIBCPP_HAS_NO_STATIC_ASSERT
271#endif
272
273#if !(__has_feature(cxx_auto_type))
274#define _LIBCPP_HAS_NO_AUTO_TYPE
275#endif
276
277#if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return)
278#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
279#endif
280
281#if !(__has_feature(cxx_variadic_templates))
282#define _LIBCPP_HAS_NO_VARIADICS
283#endif
284
285#if !(__has_feature(cxx_trailing_return))
286#define _LIBCPP_HAS_NO_TRAILING_RETURN
287#endif
288
289#if !(__has_feature(cxx_generalized_initializers))
290#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
291#endif
292
293#if __has_feature(is_base_of)
294#  define _LIBCPP_HAS_IS_BASE_OF
295#endif
296
297// Objective-C++ features (opt-in)
298#if __has_feature(objc_arc)
299#define _LIBCPP_HAS_OBJC_ARC
300#endif
301
302#if __has_feature(objc_arc_weak)
303#define _LIBCPP_HAS_OBJC_ARC_WEAK
304#define _LIBCPP_HAS_NO_STRONG_ENUMS
305#endif
306
307#if !(__has_feature(cxx_constexpr))
308#define _LIBCPP_HAS_NO_CONSTEXPR
309#endif
310
311#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
312#if defined(__FreeBSD__)
313#define _LIBCPP_HAS_QUICK_EXIT
314#define _LIBCPP_HAS_C11_FEATURES
315#elif defined(__linux__)
316#include <features.h>
317#if __GLIBC_PREREQ(2, 15)
318#define _LIBCPP_HAS_QUICK_EXIT
319#endif
320#if __GLIBC_PREREQ(2, 17)
321#define _LIBCPP_HAS_C11_FEATURES
322#endif
323#endif
324#endif
325
326#if (__has_feature(cxx_noexcept))
327#  define _NOEXCEPT noexcept
328#  define _NOEXCEPT_(x) noexcept(x)
329#  define _NOEXCEPT_OR_FALSE(x) noexcept(x)
330#else
331#  define _NOEXCEPT throw()
332#  define _NOEXCEPT_(x)
333#  define _NOEXCEPT_OR_FALSE(x) false
334#endif
335
336#if __has_feature(underlying_type)
337#  define _LIBCXX_UNDERLYING_TYPE(T) __underlying_type(T)
338#endif
339
340// Inline namespaces are available in Clang regardless of C++ dialect.
341#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
342#define _LIBCPP_END_NAMESPACE_STD  } }
343#define _VSTD std::_LIBCPP_NAMESPACE
344
345namespace std {
346  inline namespace _LIBCPP_NAMESPACE {
347  }
348}
349
350#elif defined(__GNUC__)
351
352#define _ALIGNAS(x) __attribute__((__aligned__(x)))
353#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
354
355#define _LIBCPP_NORETURN __attribute__((noreturn))
356
357#if !__EXCEPTIONS
358#define _LIBCPP_NO_EXCEPTIONS
359#endif
360
361#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
362#define _LIBCPP_HAS_NO_CONSTEXPR
363
364#define _NOEXCEPT throw()
365#define _NOEXCEPT_(x)
366#define _NOEXCEPT_OR_FALSE(x) false
367
368#ifndef __GXX_EXPERIMENTAL_CXX0X__
369
370#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
371#define _LIBCPP_HAS_NO_DECLTYPE
372#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
373#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
374#define _LIBCPP_HAS_NO_NULLPTR
375#define _LIBCPP_HAS_NO_STATIC_ASSERT
376#define _LIBCPP_HAS_NO_UNICODE_CHARS
377#define _LIBCPP_HAS_NO_VARIADICS
378#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
379#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
380#define _LIBCPP_HAS_NO_STRONG_ENUMS
381
382#else  // __GXX_EXPERIMENTAL_CXX0X__
383
384#define _LIBCPP_HAS_NO_TRAILING_RETURN
385#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
386
387#if _GNUC_VER < 403
388#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
389#endif
390
391#if _GNUC_VER < 403
392#define _LIBCPP_HAS_NO_STATIC_ASSERT
393#endif
394
395#if _GNUC_VER < 404
396#define _LIBCPP_HAS_NO_DECLTYPE
397#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
398#define _LIBCPP_HAS_NO_UNICODE_CHARS
399#define _LIBCPP_HAS_NO_VARIADICS
400#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
401#endif  // _GNUC_VER < 404
402
403#if _GNUC_VER < 406
404#define _LIBCPP_HAS_NO_NULLPTR
405#endif
406
407#if _GNUC_VER < 407
408#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
409#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
410#endif
411
412#endif  // __GXX_EXPERIMENTAL_CXX0X__
413
414#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE {
415#define _LIBCPP_END_NAMESPACE_STD  } }
416#define _VSTD std::_LIBCPP_NAMESPACE
417
418namespace std {
419namespace _LIBCPP_NAMESPACE {
420}
421using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
422}
423
424#elif defined(_LIBCPP_MSVC)
425
426#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
427#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
428#define _LIBCPP_HAS_NO_CONSTEXPR
429#define _LIBCPP_HAS_NO_UNICODE_CHARS
430#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
431#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
432#define __alignof__ __alignof
433#define _LIBCPP_NORETURN __declspec(noreturn)
434#define _ALIGNAS(x) __declspec(align(x))
435#define _LIBCPP_HAS_NO_VARIADICS
436
437#define _NOEXCEPT throw ()
438#define _NOEXCEPT_(x)
439#define _NOEXCEPT_OR_FALSE(x) false
440
441#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
442#define _LIBCPP_END_NAMESPACE_STD  }
443#define _VSTD std
444
445#  define _LIBCPP_WEAK
446namespace std {
447}
448
449#elif defined(__IBMCPP__)
450
451#define _ALIGNAS(x) __attribute__((__aligned__(x)))
452#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
453#define _ATTRIBUTE(x) __attribute__((x))
454#define _LIBCPP_NORETURN __attribute__((noreturn))
455
456#define _NOEXCEPT throw()
457#define _NOEXCEPT_(x)
458#define _NOEXCEPT_OR_FALSE(x) false
459
460#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
461#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
462#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
463#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
464#define _LIBCPP_HAS_NO_NULLPTR
465#define _LIBCPP_HAS_NO_UNICODE_CHARS
466#define _LIBCPP_HAS_IS_BASE_OF
467
468#if defined(_AIX)
469#define __MULTILOCALE_API
470#endif
471
472#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
473#define _LIBCPP_END_NAMESPACE_STD  } }
474#define _VSTD std::_LIBCPP_NAMESPACE
475
476namespace std {
477  inline namespace _LIBCPP_NAMESPACE {
478  }
479}
480
481#endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__
482
483#ifdef _LIBCPP_HAS_NO_UNICODE_CHARS
484typedef unsigned short char16_t;
485typedef unsigned int   char32_t;
486#endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
487
488#ifdef _LIBCPP_HAS_NO_STATIC_ASSERT
489
490template <bool> struct __static_assert_test;
491template <> struct __static_assert_test<true> {};
492template <unsigned> struct __static_assert_check {};
493#define static_assert(__b, __m) \
494    typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \
495    _LIBCPP_CONCAT(__t, __LINE__)
496
497#endif  // _LIBCPP_HAS_NO_STATIC_ASSERT
498
499#ifdef _LIBCPP_HAS_NO_DECLTYPE
500#define decltype(x) __typeof__(x)
501#endif
502
503#ifdef _LIBCPP_HAS_NO_CONSTEXPR
504#define _LIBCPP_CONSTEXPR
505#else
506#define _LIBCPP_CONSTEXPR constexpr
507#endif
508
509#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
510#define _LIBCPP_DEFAULT {}
511#else
512#define _LIBCPP_DEFAULT = default;
513#endif
514
515#ifdef __GNUC__
516#define _NOALIAS __attribute__((__malloc__))
517#else
518#define _NOALIAS
519#endif
520
521#ifndef __has_feature
522#define __has_feature(__x) 0
523#endif
524
525#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__)
526#   define _LIBCPP_EXPLICIT explicit
527#else
528#   define _LIBCPP_EXPLICIT
529#endif
530
531#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
532#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
533#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
534    __lx __v_; \
535    _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
536    _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
537    _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
538    };
539#else  // _LIBCPP_HAS_NO_STRONG_ENUMS
540#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x
541#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
542#endif  // _LIBCPP_HAS_NO_STRONG_ENUMS
543
544#ifdef _LIBCPP_DEBUG
545#   if _LIBCPP_DEBUG == 0
546#       define _LIBCPP_DEBUG_LEVEL 1
547#   elif _LIBCPP_DEBUG == 1
548#       define _LIBCPP_DEBUG_LEVEL 2
549#   else
550#       error Supported values for _LIBCPP_DEBUG are 0 and 1
551#   endif
552#   define _LIBCPP_EXTERN_TEMPLATE(...)
553#endif
554
555#ifndef _LIBCPP_EXTERN_TEMPLATE
556#define _LIBCPP_EXTERN_TEMPLATE(...)
557#endif
558
559#ifndef _LIBCPP_EXTERN_TEMPLATE2
560#define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__;
561#endif
562
563#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__)
564#define _LIBCPP_LOCALE__L_EXTENSIONS 1
565#endif
566
567#ifdef __FreeBSD__
568#define _DECLARE_C99_LDBL_MATH 1
569#endif
570
571#if defined(__APPLE__) || defined(__FreeBSD__)
572#define _LIBCPP_HAS_DEFAULTRUNELOCALE
573#endif
574
575#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
576#define _LIBCPP_WCTYPE_IS_MASK
577#endif
578
579#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
580#  define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
581#endif
582
583#ifndef _LIBCPP_STD_VER
584#  if  __cplusplus <= 201103L
585#    define _LIBCPP_STD_VER 11
586#  else
587#    define _LIBCPP_STD_VER 13  // current year, or date of c++14 ratification
588#  endif
589#endif  // _LIBCPP_STD_VER
590
591#if _LIBCPP_STD_VER > 11
592#define _LIBCPP_DEPRECATED [[deprecated]]
593#else
594#define _LIBCPP_DEPRECATED
595#endif
596
597#if _LIBCPP_STD_VER <= 11
598#define _LIBCPP_CONSTEXPR_AFTER_CXX11
599#define _LIBCPP_EXPLICIT_AFTER_CXX11
600#define _LIBCPP_DEPRECATED_AFTER_CXX11
601#else
602#define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
603#define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
604#define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]]
605#endif
606
607// Try to find out if RTTI is disabled.
608// g++ and cl.exe have RTTI on by default and define a macro when it is.
609// g++ only defines the macro in 4.3.2 and onwards.
610#if !defined(_LIBCPP_NO_RTTI)
611#  if defined(__GNUG__) && (__GNUC__ >= 4 && \
612   (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2)) && !defined(__GXX_RTTI)
613#    define _LIBCPP_NO_RTTI
614#  elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI)
615#    define _LIBCPP_NO_RTTI
616#  endif
617#endif
618
619#ifndef _LIBCPP_WEAK
620#  define _LIBCPP_WEAK __attribute__((__weak__))
621#endif
622
623#endif  // _LIBCPP_CONFIG
624