Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===--------------------------- __config ---------------------------------===// |
| 3 | // |
Howard Hinnant | f5256e1 | 2010-05-11 21:36:01 +0000 | [diff] [blame^] | 4 | // The LLVM Compiler Infrastructure |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 5 | // |
| 6 | // This file is distributed under the University of Illinois Open Source |
| 7 | // License. See LICENSE.TXT for details. |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifndef _LIBCPP_CONFIG |
| 12 | #define _LIBCPP_CONFIG |
| 13 | |
| 14 | #pragma GCC system_header |
| 15 | |
| 16 | #define _LIBCPP_VERSION 1000 |
| 17 | |
| 18 | #define _LIBCPP_ABI_VERSION 1 |
| 19 | |
| 20 | #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y |
| 21 | #define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) |
| 22 | |
| 23 | #define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION) |
| 24 | |
| 25 | #ifdef __LITTLE_ENDIAN__ |
| 26 | #if __LITTLE_ENDIAN__ |
| 27 | #define _LIBCPP_LITTLE_ENDIAN 1 |
| 28 | #define _LIBCPP_BIG_ENDIAN 0 |
| 29 | #endif |
| 30 | #endif |
| 31 | |
| 32 | #ifdef __BIG_ENDIAN__ |
| 33 | #if __BIG_ENDIAN__ |
| 34 | #define _LIBCPP_LITTLE_ENDIAN 0 |
| 35 | #define _LIBCPP_BIG_ENDIAN 1 |
| 36 | #endif |
| 37 | #endif |
| 38 | |
| 39 | #if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) |
| 40 | #error unable to determine endian |
| 41 | #endif |
| 42 | |
| 43 | #ifndef _LIBCPP_VISIBILITY_TAG |
| 44 | #define _LIBCPP_VISIBILITY_TAG 1 |
| 45 | #endif |
| 46 | |
| 47 | #if _LIBCPP_VISIBILITY_TAG |
| 48 | #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) |
| 49 | #define _LIBCPP_VISIBLE __attribute__ ((__visibility__("default"))) |
| 50 | #else |
| 51 | #define _LIBCPP_HIDDEN |
| 52 | #define _LIBCPP_VISIBLE |
| 53 | #endif |
| 54 | |
| 55 | #ifndef _LIBCPP_INLINE_VISIBILITY |
| 56 | #define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__)) |
| 57 | #endif |
| 58 | |
| 59 | #ifndef _LIBCPP_EXCEPTION_ABI |
| 60 | #define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) |
| 61 | #endif |
| 62 | |
| 63 | #define _LIBCPP_CANTTHROW __attribute__ ((__nothrow__)) |
| 64 | |
| 65 | #define _LIBCPP_ALWAYS_INLINE __attribute__((__always_inline__)) |
| 66 | |
| 67 | #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 |
| 68 | #define _LIBCPP_MOVE |
| 69 | #endif |
| 70 | |
| 71 | #if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) |
| 72 | #define _LIBCPP_HAS_NO_STATIC_ASSERT |
| 73 | #endif |
| 74 | |
| 75 | #define _LIBCPP_HAS_NO_NULLPTR |
| 76 | |
| 77 | #if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) |
| 78 | #define _LIBCPP_HAS_NO_VARIADICS |
| 79 | #define _LIBCPP_HAS_NO_DECLTYPE |
| 80 | #endif |
| 81 | |
| 82 | #if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) |
| 83 | #define _LIBCPP_HAS_NO_UNICODE_CHARS |
| 84 | #define _LIBCPP_HAS_NO_ADVANCED_SFINAE |
| 85 | #endif |
| 86 | |
| 87 | #if defined(__clang__) |
| 88 | #define _LIBCPP_HAS_NO_STRONG_USING |
| 89 | #endif |
| 90 | |
| 91 | #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES |
| 92 | |
| 93 | #ifdef _LIBCPP_HAS_NO_STRONG_USING |
| 94 | #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { |
| 95 | #define _LIBCPP_END_NAMESPACE_STD } |
| 96 | #define _STD std |
| 97 | #else |
| 98 | #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE { |
| 99 | #define _LIBCPP_END_NAMESPACE_STD } } |
| 100 | |
| 101 | namespace std { |
| 102 | namespace _LIBCPP_NAMESPACE { |
| 103 | } |
| 104 | using namespace _LIBCPP_NAMESPACE __attribute__((__strong__)); |
| 105 | } |
| 106 | |
| 107 | #define _STD std::_LIBCPP_NAMESPACE |
| 108 | #endif |
| 109 | |
| 110 | #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS |
| 111 | typedef unsigned short char16_t; |
| 112 | typedef unsigned int char32_t; |
| 113 | #endif |
| 114 | |
| 115 | #ifdef _LIBCPP_HAS_NO_STATIC_ASSERT |
| 116 | |
| 117 | template <bool> struct __static_assert_test; |
| 118 | template <> struct __static_assert_test<true> {}; |
| 119 | template <unsigned> struct __static_assert_check {}; |
| 120 | #define static_assert(__b, __m) \ |
| 121 | typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \ |
| 122 | _LIBCPP_CONCAT(__t, __LINE__) |
| 123 | |
| 124 | #endif |
| 125 | |
| 126 | #ifdef _LIBCPP_HAS_NO_DECLTYPE |
| 127 | |
| 128 | #define decltype(x) __typeof__(x) |
| 129 | |
| 130 | #endif |
| 131 | |
| 132 | #if !__EXCEPTIONS |
| 133 | #define _LIBCPP_NO_EXCEPTIONS |
| 134 | #endif |
| 135 | |
| 136 | #endif // _LIBCPP_CONFIG |