| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- | 
|  | 2 | //===--------------------------- __config ---------------------------------===// | 
|  | 3 | // | 
| Howard Hinnant | 5b08a8a | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 4 | //                     The LLVM Compiler Infrastructure | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 5 | // | 
| Howard Hinnant | 412dbeb | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 6 | // This file is dual licensed under the MIT and the University of Illinois Open | 
|  | 7 | // Source Licenses. See LICENSE.TXT for details. | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 8 | // | 
|  | 9 | //===----------------------------------------------------------------------===// | 
|  | 10 |  | 
|  | 11 | #ifndef _LIBCPP_CONFIG | 
|  | 12 | #define _LIBCPP_CONFIG | 
|  | 13 |  | 
| Howard Hinnant | 0be8f64 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 14 | #if !defined(_MSC_VER) || defined(__clang__) | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 15 | #pragma GCC system_header | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 16 | #endif | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 17 |  | 
| Howard Hinnant | f543a75 | 2012-10-03 20:48:05 +0000 | [diff] [blame] | 18 | #ifdef __GNUC__ | 
|  | 19 | #define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) | 
| Eric Fiselier | 678ad2f | 2015-06-13 02:18:44 +0000 | [diff] [blame] | 20 | #else | 
|  | 21 | #define _GNUC_VER 0 | 
| Howard Hinnant | f543a75 | 2012-10-03 20:48:05 +0000 | [diff] [blame] | 22 | #endif | 
|  | 23 |  | 
| Marshall Clow | 34389c8 | 2015-07-17 16:36:44 +0000 | [diff] [blame] | 24 | #define _LIBCPP_VERSION 3800 | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 25 |  | 
| Evgeniy Stepanov | a66a7b3 | 2015-10-13 23:48:28 +0000 | [diff] [blame^] | 26 | #ifndef _LIBCPP_ABI_VERSION | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 27 | #define _LIBCPP_ABI_VERSION 1 | 
| Evgeniy Stepanov | a66a7b3 | 2015-10-13 23:48:28 +0000 | [diff] [blame^] | 28 | #endif | 
|  | 29 |  | 
|  | 30 | #if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2 | 
|  | 31 | #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT | 
|  | 32 | #endif | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 33 |  | 
|  | 34 | #define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y | 
|  | 35 | #define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) | 
|  | 36 |  | 
|  | 37 | #define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION) | 
|  | 38 |  | 
| Eric Fiselier | e825d8b | 2015-07-10 20:26:38 +0000 | [diff] [blame] | 39 |  | 
|  | 40 | #ifndef __has_attribute | 
|  | 41 | #define __has_attribute(__x) 0 | 
|  | 42 | #endif | 
|  | 43 | #ifndef __has_builtin | 
|  | 44 | #define __has_builtin(__x) 0 | 
|  | 45 | #endif | 
| Eric Fiselier | 749adeb | 2015-08-19 17:21:46 +0000 | [diff] [blame] | 46 | #ifndef __has_extension | 
|  | 47 | #define __has_extension(__x) 0 | 
|  | 48 | #endif | 
| Eric Fiselier | e825d8b | 2015-07-10 20:26:38 +0000 | [diff] [blame] | 49 | #ifndef __has_feature | 
|  | 50 | #define __has_feature(__x) 0 | 
|  | 51 | #endif | 
|  | 52 | // '__is_identifier' returns '0' if '__x' is a reserved identifier provided by | 
|  | 53 | // the compiler and '1' otherwise. | 
|  | 54 | #ifndef __is_identifier | 
|  | 55 | #define __is_identifier(__x) 1 | 
|  | 56 | #endif | 
|  | 57 |  | 
|  | 58 |  | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 59 | #ifdef __LITTLE_ENDIAN__ | 
|  | 60 | #if __LITTLE_ENDIAN__ | 
|  | 61 | #define _LIBCPP_LITTLE_ENDIAN 1 | 
|  | 62 | #define _LIBCPP_BIG_ENDIAN    0 | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 63 | #endif  // __LITTLE_ENDIAN__ | 
|  | 64 | #endif  // __LITTLE_ENDIAN__ | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 65 |  | 
|  | 66 | #ifdef __BIG_ENDIAN__ | 
|  | 67 | #if __BIG_ENDIAN__ | 
|  | 68 | #define _LIBCPP_LITTLE_ENDIAN 0 | 
|  | 69 | #define _LIBCPP_BIG_ENDIAN    1 | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 70 | #endif  // __BIG_ENDIAN__ | 
|  | 71 | #endif  // __BIG_ENDIAN__ | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 72 |  | 
| Dan Albert | 5e61cfd | 2015-09-16 18:10:47 +0000 | [diff] [blame] | 73 | #ifdef __BYTE_ORDER__ | 
|  | 74 | #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ | 
|  | 75 | #define _LIBCPP_LITTLE_ENDIAN 1 | 
|  | 76 | #define _LIBCPP_BIG_ENDIAN 0 | 
|  | 77 | #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | 
|  | 78 | #define _LIBCPP_LITTLE_ENDIAN 0 | 
|  | 79 | #define _LIBCPP_BIG_ENDIAN 1 | 
|  | 80 | #endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | 
|  | 81 | #endif // __BYTE_ORDER__ | 
|  | 82 |  | 
| David Chisnall | 2a072dd | 2010-08-11 16:27:20 +0000 | [diff] [blame] | 83 | #ifdef __FreeBSD__ | 
|  | 84 | # include <sys/endian.h> | 
|  | 85 | #  if _BYTE_ORDER == _LITTLE_ENDIAN | 
|  | 86 | #   define _LIBCPP_LITTLE_ENDIAN 1 | 
|  | 87 | #   define _LIBCPP_BIG_ENDIAN    0 | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 88 | # else  // _BYTE_ORDER == _LITTLE_ENDIAN | 
| David Chisnall | 2a072dd | 2010-08-11 16:27:20 +0000 | [diff] [blame] | 89 | #   define _LIBCPP_LITTLE_ENDIAN 0 | 
|  | 90 | #   define _LIBCPP_BIG_ENDIAN    1 | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 91 | # endif  // _BYTE_ORDER == _LITTLE_ENDIAN | 
| Howard Hinnant | f8b24cf | 2012-11-26 21:18:17 +0000 | [diff] [blame] | 92 | # ifndef __LONG_LONG_SUPPORTED | 
|  | 93 | #  define _LIBCPP_HAS_NO_LONG_LONG | 
|  | 94 | # endif  // __LONG_LONG_SUPPORTED | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 95 | #endif  // __FreeBSD__ | 
| David Chisnall | 2a072dd | 2010-08-11 16:27:20 +0000 | [diff] [blame] | 96 |  | 
| Joerg Sonnenberger | 50544e7 | 2013-05-17 21:17:34 +0000 | [diff] [blame] | 97 | #ifdef __NetBSD__ | 
|  | 98 | # include <sys/endian.h> | 
|  | 99 | #  if _BYTE_ORDER == _LITTLE_ENDIAN | 
|  | 100 | #   define _LIBCPP_LITTLE_ENDIAN 1 | 
|  | 101 | #   define _LIBCPP_BIG_ENDIAN    0 | 
|  | 102 | # else  // _BYTE_ORDER == _LITTLE_ENDIAN | 
|  | 103 | #   define _LIBCPP_LITTLE_ENDIAN 0 | 
|  | 104 | #   define _LIBCPP_BIG_ENDIAN    1 | 
|  | 105 | # endif  // _BYTE_ORDER == _LITTLE_ENDIAN | 
|  | 106 | # define _LIBCPP_HAS_QUICK_EXIT | 
|  | 107 | #endif  // __NetBSD__ | 
|  | 108 |  | 
| Howard Hinnant | 3e71464 | 2011-05-13 17:16:06 +0000 | [diff] [blame] | 109 | #ifdef _WIN32 | 
|  | 110 | #  define _LIBCPP_LITTLE_ENDIAN 1 | 
|  | 111 | #  define _LIBCPP_BIG_ENDIAN    0 | 
| Eric Fiselier | ee187e2 | 2015-06-13 07:08:02 +0000 | [diff] [blame] | 112 | // Compiler intrinsics (MSVC) | 
|  | 113 | #if defined(_MSC_VER) && _MSC_VER >= 1400 | 
| Howard Hinnant | 0be8f64 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 114 | #    define _LIBCPP_HAS_IS_BASE_OF | 
| Howard Hinnant | 3c78ca0 | 2011-09-22 19:10:18 +0000 | [diff] [blame] | 115 | #  endif | 
| Howard Hinnant | 0be8f64 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 116 | #  if defined(_MSC_VER) && !defined(__clang__) | 
|  | 117 | #    define _LIBCPP_MSVC // Using Microsoft Visual C++ compiler | 
| Howard Hinnant | 80b84d4 | 2013-10-04 21:14:44 +0000 | [diff] [blame] | 118 | #    define _LIBCPP_TOSTRING2(x) #x | 
|  | 119 | #    define _LIBCPP_TOSTRING(x) _LIBCPP_TOSTRING2(x) | 
|  | 120 | #    define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x)) | 
| Howard Hinnant | 0be8f64 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 121 | #  endif | 
| Howard Hinnant | 5f878d4 | 2013-09-17 01:34:47 +0000 | [diff] [blame] | 122 | #  // If mingw not explicitly detected, assume using MS C runtime only. | 
|  | 123 | #  ifndef __MINGW32__ | 
|  | 124 | #    define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library | 
|  | 125 | #  endif | 
| Howard Hinnant | 3e71464 | 2011-05-13 17:16:06 +0000 | [diff] [blame] | 126 | #endif  // _WIN32 | 
|  | 127 |  | 
| David Chisnall | 14c25b8 | 2012-02-29 13:05:08 +0000 | [diff] [blame] | 128 | #ifdef __sun__ | 
|  | 129 | # include <sys/isa_defs.h> | 
|  | 130 | # ifdef _LITTLE_ENDIAN | 
|  | 131 | #   define _LIBCPP_LITTLE_ENDIAN 1 | 
|  | 132 | #   define _LIBCPP_BIG_ENDIAN    0 | 
|  | 133 | # else | 
|  | 134 | #   define _LIBCPP_LITTLE_ENDIAN 0 | 
|  | 135 | #   define _LIBCPP_BIG_ENDIAN    1 | 
|  | 136 | # endif | 
|  | 137 | #endif // __sun__ | 
|  | 138 |  | 
| Ed Schouten | 17f5dbe | 2015-03-10 07:46:06 +0000 | [diff] [blame] | 139 | #if defined(__CloudABI__) | 
|  | 140 | // Certain architectures provide arc4random(). Prefer using | 
|  | 141 | // arc4random() over /dev/{u,}random to make it possible to obtain | 
|  | 142 | // random data even when using sandboxing mechanisms such as chroots, | 
|  | 143 | // Capsicum, etc. | 
|  | 144 | # define _LIBCPP_USING_ARC4_RANDOM | 
|  | 145 | #elif defined(__native_client__) | 
| JF Bastien | 57148cb | 2014-12-01 19:19:55 +0000 | [diff] [blame] | 146 | // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access, | 
|  | 147 | // including accesses to the special files under /dev. C++11's | 
|  | 148 | // std::random_device is instead exposed through a NaCl syscall. | 
|  | 149 | # define _LIBCPP_USING_NACL_RANDOM | 
| Ed Schouten | 17f5dbe | 2015-03-10 07:46:06 +0000 | [diff] [blame] | 150 | #elif defined(_WIN32) | 
|  | 151 | # define _LIBCPP_USING_WIN32_RANDOM | 
|  | 152 | #else | 
|  | 153 | # define _LIBCPP_USING_DEV_RANDOM | 
|  | 154 | #endif | 
| JF Bastien | 57148cb | 2014-12-01 19:19:55 +0000 | [diff] [blame] | 155 |  | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 156 | #if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) | 
| Howard Hinnant | 128ba71 | 2010-05-24 17:49:41 +0000 | [diff] [blame] | 157 | # include <endian.h> | 
|  | 158 | # if __BYTE_ORDER == __LITTLE_ENDIAN | 
|  | 159 | #  define _LIBCPP_LITTLE_ENDIAN 1 | 
|  | 160 | #  define _LIBCPP_BIG_ENDIAN    0 | 
|  | 161 | # elif __BYTE_ORDER == __BIG_ENDIAN | 
|  | 162 | #  define _LIBCPP_LITTLE_ENDIAN 0 | 
|  | 163 | #  define _LIBCPP_BIG_ENDIAN    1 | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 164 | # else  // __BYTE_ORDER == __BIG_ENDIAN | 
| Howard Hinnant | 128ba71 | 2010-05-24 17:49:41 +0000 | [diff] [blame] | 165 | #  error unable to determine endian | 
|  | 166 | # endif | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 167 | #endif  // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 168 |  | 
| Marshall Clow | 91907cb | 2013-03-18 17:04:29 +0000 | [diff] [blame] | 169 | #ifdef _WIN32 | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 170 |  | 
|  | 171 | // only really useful for a DLL | 
|  | 172 | #ifdef _LIBCPP_DLL // this should be a compiler builtin define ideally... | 
|  | 173 | # ifdef cxx_EXPORTS | 
|  | 174 | #  define _LIBCPP_HIDDEN | 
| Howard Hinnant | 6e41256 | 2013-03-06 23:30:19 +0000 | [diff] [blame] | 175 | #  define _LIBCPP_FUNC_VIS __declspec(dllexport) | 
|  | 176 | #  define _LIBCPP_TYPE_VIS __declspec(dllexport) | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 177 | # else | 
|  | 178 | #  define _LIBCPP_HIDDEN | 
| Howard Hinnant | 6e41256 | 2013-03-06 23:30:19 +0000 | [diff] [blame] | 179 | #  define _LIBCPP_FUNC_VIS __declspec(dllimport) | 
|  | 180 | #  define _LIBCPP_TYPE_VIS __declspec(dllimport) | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 181 | # endif | 
|  | 182 | #else | 
|  | 183 | # define _LIBCPP_HIDDEN | 
| Howard Hinnant | 6e41256 | 2013-03-06 23:30:19 +0000 | [diff] [blame] | 184 | # define _LIBCPP_FUNC_VIS | 
|  | 185 | # define _LIBCPP_TYPE_VIS | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 186 | #endif | 
|  | 187 |  | 
| Howard Hinnant | f0544c2 | 2013-08-12 18:38:34 +0000 | [diff] [blame] | 188 | #define _LIBCPP_TYPE_VIS_ONLY | 
|  | 189 | #define _LIBCPP_FUNC_VIS_ONLY | 
|  | 190 |  | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 191 | #ifndef _LIBCPP_INLINE_VISIBILITY | 
| Howard Hinnant | 0be8f64 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 192 | # ifdef _LIBCPP_MSVC | 
| Howard Hinnant | 8bece6f | 2011-10-20 12:49:21 +0000 | [diff] [blame] | 193 | #  define _LIBCPP_INLINE_VISIBILITY __forceinline | 
|  | 194 | # else // MinGW GCC and Clang | 
|  | 195 | #  define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__always_inline__)) | 
|  | 196 | # endif | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 197 | #endif | 
|  | 198 |  | 
|  | 199 | #ifndef _LIBCPP_EXCEPTION_ABI | 
| Howard Hinnant | 6e41256 | 2013-03-06 23:30:19 +0000 | [diff] [blame] | 200 | #define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 201 | #endif | 
|  | 202 |  | 
|  | 203 | #ifndef _LIBCPP_ALWAYS_INLINE | 
| Howard Hinnant | 0be8f64 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 204 | # ifdef _LIBCPP_MSVC | 
| Howard Hinnant | 8bece6f | 2011-10-20 12:49:21 +0000 | [diff] [blame] | 205 | #  define _LIBCPP_ALWAYS_INLINE __forceinline | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 206 | # endif | 
|  | 207 | #endif | 
|  | 208 |  | 
|  | 209 | #endif // _WIN32 | 
|  | 210 |  | 
|  | 211 | #ifndef _LIBCPP_HIDDEN | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 212 | #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 213 | #endif | 
|  | 214 |  | 
| Howard Hinnant | 6e41256 | 2013-03-06 23:30:19 +0000 | [diff] [blame] | 215 | #ifndef _LIBCPP_FUNC_VIS | 
|  | 216 | #define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default"))) | 
|  | 217 | #endif | 
|  | 218 |  | 
|  | 219 | #ifndef _LIBCPP_TYPE_VIS | 
| Howard Hinnant | ccad8c3 | 2013-11-13 00:39:22 +0000 | [diff] [blame] | 220 | #  if __has_attribute(__type_visibility__) | 
| Howard Hinnant | ead480d | 2013-03-07 19:25:03 +0000 | [diff] [blame] | 221 | #    define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default"))) | 
|  | 222 | #  else | 
|  | 223 | #    define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default"))) | 
|  | 224 | #  endif | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 225 | #endif | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 226 |  | 
| Howard Hinnant | f0544c2 | 2013-08-12 18:38:34 +0000 | [diff] [blame] | 227 | #ifndef _LIBCPP_TYPE_VIS_ONLY | 
|  | 228 | # define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS | 
|  | 229 | #endif | 
|  | 230 |  | 
|  | 231 | #ifndef _LIBCPP_FUNC_VIS_ONLY | 
|  | 232 | # define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS | 
|  | 233 | #endif | 
|  | 234 |  | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 235 | #ifndef _LIBCPP_INLINE_VISIBILITY | 
|  | 236 | #define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__)) | 
|  | 237 | #endif | 
|  | 238 |  | 
|  | 239 | #ifndef _LIBCPP_EXCEPTION_ABI | 
| Howard Hinnant | 395485e | 2013-12-04 21:03:23 +0000 | [diff] [blame] | 240 | #define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default"))) | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 241 | #endif | 
|  | 242 |  | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 243 | #ifndef _LIBCPP_ALWAYS_INLINE | 
| Howard Hinnant | c950e77 | 2010-12-17 14:46:43 +0000 | [diff] [blame] | 244 | #define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__visibility__("hidden"), __always_inline__)) | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 245 | #endif | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 246 |  | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 247 | #if defined(__clang__) | 
|  | 248 |  | 
| Evgeniy Stepanov | a66a7b3 | 2015-10-13 23:48:28 +0000 | [diff] [blame^] | 249 | // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for | 
|  | 250 | // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility. | 
|  | 251 | #if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) &&       \ | 
|  | 252 | !defined(__arm__)) ||                                                     \ | 
|  | 253 | defined(_LIBCPP_ALTERNATE_STRING_LAYOUT) | 
|  | 254 | #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT | 
| Tim Northover | c3a57e9 | 2014-03-30 11:34:22 +0000 | [diff] [blame] | 255 | #endif | 
|  | 256 |  | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 257 | #if __has_feature(cxx_alignas) | 
| Howard Hinnant | bf33f5b | 2012-05-31 19:31:14 +0000 | [diff] [blame] | 258 | #  define _ALIGNAS_TYPE(x) alignas(x) | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 259 | #  define _ALIGNAS(x) alignas(x) | 
|  | 260 | #else | 
| Howard Hinnant | 78b4015 | 2012-05-31 20:14:00 +0000 | [diff] [blame] | 261 | #  define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 262 | #  define _ALIGNAS(x) __attribute__((__aligned__(x))) | 
|  | 263 | #endif | 
|  | 264 |  | 
| Howard Hinnant | 411d1bc | 2011-05-26 19:07:54 +0000 | [diff] [blame] | 265 | #if !__has_feature(cxx_alias_templates) | 
| Howard Hinnant | 7609c9b | 2010-09-04 23:28:19 +0000 | [diff] [blame] | 266 | #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES | 
| Howard Hinnant | 411d1bc | 2011-05-26 19:07:54 +0000 | [diff] [blame] | 267 | #endif | 
| Howard Hinnant | 01fd310 | 2010-09-07 20:31:18 +0000 | [diff] [blame] | 268 |  | 
| Marshall Clow | 31be78b | 2014-02-22 15:13:48 +0000 | [diff] [blame] | 269 | #if __cplusplus < 201103L | 
| Howard Hinnant | d8e7922 | 2010-09-16 23:27:26 +0000 | [diff] [blame] | 270 | typedef __char16_t char16_t; | 
|  | 271 | typedef __char32_t char32_t; | 
| Howard Hinnant | 01fd310 | 2010-09-07 20:31:18 +0000 | [diff] [blame] | 272 | #endif | 
| Howard Hinnant | 7609c9b | 2010-09-04 23:28:19 +0000 | [diff] [blame] | 273 |  | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 274 | #if !(__has_feature(cxx_exceptions)) | 
|  | 275 | #define _LIBCPP_NO_EXCEPTIONS | 
|  | 276 | #endif | 
|  | 277 |  | 
| Howard Hinnant | 54b409f | 2010-08-11 17:04:31 +0000 | [diff] [blame] | 278 | #if !(__has_feature(cxx_rtti)) | 
|  | 279 | #define _LIBCPP_NO_RTTI | 
|  | 280 | #endif | 
|  | 281 |  | 
| Howard Hinnant | 75689c1 | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 282 | #if !(__has_feature(cxx_strong_enums)) | 
|  | 283 | #define _LIBCPP_HAS_NO_STRONG_ENUMS | 
|  | 284 | #endif | 
|  | 285 |  | 
| Howard Hinnant | 7609c9b | 2010-09-04 23:28:19 +0000 | [diff] [blame] | 286 | #if !(__has_feature(cxx_decltype)) | 
|  | 287 | #define _LIBCPP_HAS_NO_DECLTYPE | 
|  | 288 | #endif | 
|  | 289 |  | 
| Howard Hinnant | 400b244 | 2011-05-26 17:07:32 +0000 | [diff] [blame] | 290 | #if __has_feature(cxx_attributes) | 
| Richard Smith | 535a86c | 2012-07-26 02:04:22 +0000 | [diff] [blame] | 291 | #  define _LIBCPP_NORETURN [[noreturn]] | 
| Howard Hinnant | 400b244 | 2011-05-26 17:07:32 +0000 | [diff] [blame] | 292 | #else | 
| Richard Smith | 535a86c | 2012-07-26 02:04:22 +0000 | [diff] [blame] | 293 | #  define _LIBCPP_NORETURN __attribute__ ((noreturn)) | 
| Howard Hinnant | 7609c9b | 2010-09-04 23:28:19 +0000 | [diff] [blame] | 294 | #endif | 
|  | 295 |  | 
| Dimitry Andric | b1e78df | 2015-02-05 07:40:48 +0000 | [diff] [blame] | 296 | #define _LIBCPP_UNUSED __attribute__((__unused__)) | 
|  | 297 |  | 
| Howard Hinnant | da9ca0b | 2013-05-02 20:18:43 +0000 | [diff] [blame] | 298 | #if !(__has_feature(cxx_defaulted_functions)) | 
| Howard Hinnant | 7609c9b | 2010-09-04 23:28:19 +0000 | [diff] [blame] | 299 | #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS | 
| Howard Hinnant | da9ca0b | 2013-05-02 20:18:43 +0000 | [diff] [blame] | 300 | #endif  // !(__has_feature(cxx_defaulted_functions)) | 
| Howard Hinnant | 7387390 | 2010-09-29 18:13:54 +0000 | [diff] [blame] | 301 |  | 
|  | 302 | #if !(__has_feature(cxx_deleted_functions)) | 
| Howard Hinnant | 7609c9b | 2010-09-04 23:28:19 +0000 | [diff] [blame] | 303 | #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS | 
|  | 304 | #endif  // !(__has_feature(cxx_deleted_functions)) | 
|  | 305 |  | 
|  | 306 | #if !(__has_feature(cxx_lambdas)) | 
|  | 307 | #define _LIBCPP_HAS_NO_LAMBDAS | 
|  | 308 | #endif | 
|  | 309 |  | 
|  | 310 | #if !(__has_feature(cxx_nullptr)) | 
|  | 311 | #define _LIBCPP_HAS_NO_NULLPTR | 
|  | 312 | #endif | 
|  | 313 |  | 
|  | 314 | #if !(__has_feature(cxx_rvalue_references)) | 
|  | 315 | #define _LIBCPP_HAS_NO_RVALUE_REFERENCES | 
|  | 316 | #endif | 
|  | 317 |  | 
|  | 318 | #if !(__has_feature(cxx_static_assert)) | 
|  | 319 | #define _LIBCPP_HAS_NO_STATIC_ASSERT | 
|  | 320 | #endif | 
|  | 321 |  | 
|  | 322 | #if !(__has_feature(cxx_auto_type)) | 
|  | 323 | #define _LIBCPP_HAS_NO_AUTO_TYPE | 
| Howard Hinnant | 89bdcd7 | 2011-07-29 21:35:53 +0000 | [diff] [blame] | 324 | #endif | 
|  | 325 |  | 
| Howard Hinnant | 2425d53 | 2011-07-31 17:10:44 +0000 | [diff] [blame] | 326 | #if !(__has_feature(cxx_access_control_sfinae)) || !__has_feature(cxx_trailing_return) | 
| Howard Hinnant | 08ad63b | 2011-05-11 20:19:40 +0000 | [diff] [blame] | 327 | #define _LIBCPP_HAS_NO_ADVANCED_SFINAE | 
| Howard Hinnant | 7609c9b | 2010-09-04 23:28:19 +0000 | [diff] [blame] | 328 | #endif | 
|  | 329 |  | 
|  | 330 | #if !(__has_feature(cxx_variadic_templates)) | 
|  | 331 | #define _LIBCPP_HAS_NO_VARIADICS | 
|  | 332 | #endif | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 333 |  | 
| Howard Hinnant | c4931c4 | 2010-11-16 21:10:23 +0000 | [diff] [blame] | 334 | #if !(__has_feature(cxx_trailing_return)) | 
|  | 335 | #define _LIBCPP_HAS_NO_TRAILING_RETURN | 
|  | 336 | #endif | 
|  | 337 |  | 
| Howard Hinnant | 54976f2 | 2011-08-12 21:56:02 +0000 | [diff] [blame] | 338 | #if !(__has_feature(cxx_generalized_initializers)) | 
|  | 339 | #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS | 
|  | 340 | #endif | 
|  | 341 |  | 
| Howard Hinnant | 3c78ca0 | 2011-09-22 19:10:18 +0000 | [diff] [blame] | 342 | #if __has_feature(is_base_of) | 
| Howard Hinnant | 0be8f64 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 343 | #  define _LIBCPP_HAS_IS_BASE_OF | 
| Howard Hinnant | 3c78ca0 | 2011-09-22 19:10:18 +0000 | [diff] [blame] | 344 | #endif | 
|  | 345 |  | 
| Eric Fiselier | ee187e2 | 2015-06-13 07:08:02 +0000 | [diff] [blame] | 346 | #if __has_feature(is_final) | 
|  | 347 | #  define _LIBCPP_HAS_IS_FINAL | 
|  | 348 | #endif | 
|  | 349 |  | 
| Douglas Gregor | 64ec101 | 2011-06-22 22:17:44 +0000 | [diff] [blame] | 350 | // Objective-C++ features (opt-in) | 
|  | 351 | #if __has_feature(objc_arc) | 
|  | 352 | #define _LIBCPP_HAS_OBJC_ARC | 
|  | 353 | #endif | 
|  | 354 |  | 
|  | 355 | #if __has_feature(objc_arc_weak) | 
|  | 356 | #define _LIBCPP_HAS_OBJC_ARC_WEAK | 
| Howard Hinnant | 75689c1 | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 357 | #define _LIBCPP_HAS_NO_STRONG_ENUMS | 
| Douglas Gregor | 64ec101 | 2011-06-22 22:17:44 +0000 | [diff] [blame] | 358 | #endif | 
|  | 359 |  | 
| Howard Hinnant | db3e997 | 2010-09-06 19:10:31 +0000 | [diff] [blame] | 360 | #if !(__has_feature(cxx_constexpr)) | 
|  | 361 | #define _LIBCPP_HAS_NO_CONSTEXPR | 
|  | 362 | #endif | 
|  | 363 |  | 
| Eric Fiselier | 371aac1 | 2014-07-17 05:16:18 +0000 | [diff] [blame] | 364 | #if !(__has_feature(cxx_relaxed_constexpr)) | 
|  | 365 | #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR | 
|  | 366 | #endif | 
|  | 367 |  | 
| Marshall Clow | 2d832d2 | 2015-03-17 15:30:22 +0000 | [diff] [blame] | 368 | #if !(__has_feature(cxx_variable_templates)) | 
|  | 369 | #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES | 
|  | 370 | #endif | 
|  | 371 |  | 
| David Blaikie | f13dbe4 | 2013-05-13 21:53:44 +0000 | [diff] [blame] | 372 | #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L | 
|  | 373 | #if defined(__FreeBSD__) | 
| David Chisnall | 5f13d66 | 2012-03-14 14:10:37 +0000 | [diff] [blame] | 374 | #define _LIBCPP_HAS_QUICK_EXIT | 
| Howard Hinnant | 7ba8160 | 2012-10-13 18:03:53 +0000 | [diff] [blame] | 375 | #define _LIBCPP_HAS_C11_FEATURES | 
| Marshall Clow | b38f8f0 | 2014-07-10 15:20:28 +0000 | [diff] [blame] | 376 | #elif defined(__ANDROID__) | 
|  | 377 | #define _LIBCPP_HAS_QUICK_EXIT | 
| David Blaikie | f13dbe4 | 2013-05-13 21:53:44 +0000 | [diff] [blame] | 378 | #elif defined(__linux__) | 
|  | 379 | #include <features.h> | 
|  | 380 | #if __GLIBC_PREREQ(2, 15) | 
|  | 381 | #define _LIBCPP_HAS_QUICK_EXIT | 
|  | 382 | #endif | 
|  | 383 | #if __GLIBC_PREREQ(2, 17) | 
|  | 384 | #define _LIBCPP_HAS_C11_FEATURES | 
|  | 385 | #endif | 
|  | 386 | #endif | 
| David Chisnall | 5f13d66 | 2012-03-14 14:10:37 +0000 | [diff] [blame] | 387 | #endif | 
|  | 388 |  | 
| Howard Hinnant | 08ad63b | 2011-05-11 20:19:40 +0000 | [diff] [blame] | 389 | #if (__has_feature(cxx_noexcept)) | 
|  | 390 | #  define _NOEXCEPT noexcept | 
|  | 391 | #  define _NOEXCEPT_(x) noexcept(x) | 
| Marshall Clow | d41295da | 2014-01-03 18:21:14 +0000 | [diff] [blame] | 392 | #  define _NOEXCEPT_OR_FALSE(x) noexcept(x) | 
| Howard Hinnant | 08ad63b | 2011-05-11 20:19:40 +0000 | [diff] [blame] | 393 | #else | 
|  | 394 | #  define _NOEXCEPT throw() | 
|  | 395 | #  define _NOEXCEPT_(x) | 
| Marshall Clow | d41295da | 2014-01-03 18:21:14 +0000 | [diff] [blame] | 396 | #  define _NOEXCEPT_OR_FALSE(x) false | 
| Howard Hinnant | 08ad63b | 2011-05-11 20:19:40 +0000 | [diff] [blame] | 397 | #endif | 
|  | 398 |  | 
| Alexis Hunt | 397d787 | 2011-07-18 18:37:21 +0000 | [diff] [blame] | 399 | #if __has_feature(underlying_type) | 
| Marshall Clow | 157a8f9 | 2014-06-26 01:07:56 +0000 | [diff] [blame] | 400 | #  define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) | 
|  | 401 | #endif | 
|  | 402 |  | 
|  | 403 | #if __has_feature(is_literal) | 
|  | 404 | #  define _LIBCPP_IS_LITERAL(T) __is_literal(T) | 
| Alexis Hunt | 397d787 | 2011-07-18 18:37:21 +0000 | [diff] [blame] | 405 | #endif | 
|  | 406 |  | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 407 | // Inline namespaces are available in Clang regardless of C++ dialect. | 
|  | 408 | #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE { | 
|  | 409 | #define _LIBCPP_END_NAMESPACE_STD  } } | 
|  | 410 | #define _VSTD std::_LIBCPP_NAMESPACE | 
|  | 411 |  | 
|  | 412 | namespace std { | 
|  | 413 | inline namespace _LIBCPP_NAMESPACE { | 
|  | 414 | } | 
|  | 415 | } | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 416 |  | 
| Marshall Clow | 91c71dd | 2014-04-14 15:44:57 +0000 | [diff] [blame] | 417 | #if !defined(_LIBCPP_HAS_NO_ASAN) && !__has_feature(address_sanitizer) | 
|  | 418 | #define _LIBCPP_HAS_NO_ASAN | 
|  | 419 | #endif | 
|  | 420 |  | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 421 | #elif defined(__GNUC__) | 
|  | 422 |  | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 423 | #define _ALIGNAS(x) __attribute__((__aligned__(x))) | 
| Howard Hinnant | a3b7a80 | 2012-08-19 17:14:47 +0000 | [diff] [blame] | 424 | #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 425 |  | 
| Richard Smith | 535a86c | 2012-07-26 02:04:22 +0000 | [diff] [blame] | 426 | #define _LIBCPP_NORETURN __attribute__((noreturn)) | 
| Howard Hinnant | f5c9147 | 2011-05-31 13:13:49 +0000 | [diff] [blame] | 427 |  | 
| Dimitry Andric | b1e78df | 2015-02-05 07:40:48 +0000 | [diff] [blame] | 428 | #define _LIBCPP_UNUSED __attribute__((__unused__)) | 
|  | 429 |  | 
| Marshall Clow | 157a8f9 | 2014-06-26 01:07:56 +0000 | [diff] [blame] | 430 | #if _GNUC_VER >= 407 | 
|  | 431 | #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) | 
|  | 432 | #define _LIBCPP_IS_LITERAL(T) __is_literal_type(T) | 
| Eric Fiselier | ee187e2 | 2015-06-13 07:08:02 +0000 | [diff] [blame] | 433 | #define _LIBCPP_HAS_IS_FINAL | 
|  | 434 | #endif | 
|  | 435 |  | 
|  | 436 | #if defined(__GNUC__) && _GNUC_VER >= 403 | 
|  | 437 | #  define _LIBCPP_HAS_IS_BASE_OF | 
| Marshall Clow | 157a8f9 | 2014-06-26 01:07:56 +0000 | [diff] [blame] | 438 | #endif | 
|  | 439 |  | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 440 | #if !__EXCEPTIONS | 
|  | 441 | #define _LIBCPP_NO_EXCEPTIONS | 
|  | 442 | #endif | 
|  | 443 |  | 
|  | 444 | #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES | 
| Nico Weber | 1d1b46c | 2014-06-04 15:46:56 +0000 | [diff] [blame] | 445 |  | 
|  | 446 | // constexpr was added to GCC in 4.6. | 
|  | 447 | #if _GNUC_VER < 406 | 
| Howard Hinnant | db3e997 | 2010-09-06 19:10:31 +0000 | [diff] [blame] | 448 | #define _LIBCPP_HAS_NO_CONSTEXPR | 
| Nico Weber | 1d1b46c | 2014-06-04 15:46:56 +0000 | [diff] [blame] | 449 | // Can only use constexpr in c++11 mode. | 
|  | 450 | #elif !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L | 
|  | 451 | #define _LIBCPP_HAS_NO_CONSTEXPR | 
|  | 452 | #endif | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 453 |  | 
| Eric Fiselier | 371aac1 | 2014-07-17 05:16:18 +0000 | [diff] [blame] | 454 | // No version of GCC supports relaxed constexpr rules | 
|  | 455 | #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR | 
| Marshall Clow | 2d832d2 | 2015-03-17 15:30:22 +0000 | [diff] [blame] | 456 | // GCC 5 will support variable templates | 
|  | 457 | #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES | 
| Eric Fiselier | 371aac1 | 2014-07-17 05:16:18 +0000 | [diff] [blame] | 458 |  | 
| Howard Hinnant | 08ad63b | 2011-05-11 20:19:40 +0000 | [diff] [blame] | 459 | #define _NOEXCEPT throw() | 
|  | 460 | #define _NOEXCEPT_(x) | 
| Marshall Clow | d41295da | 2014-01-03 18:21:14 +0000 | [diff] [blame] | 461 | #define _NOEXCEPT_OR_FALSE(x) false | 
| Howard Hinnant | 08ad63b | 2011-05-11 20:19:40 +0000 | [diff] [blame] | 462 |  | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 463 | #ifndef __GXX_EXPERIMENTAL_CXX0X__ | 
|  | 464 |  | 
|  | 465 | #define _LIBCPP_HAS_NO_ADVANCED_SFINAE | 
|  | 466 | #define _LIBCPP_HAS_NO_DECLTYPE | 
|  | 467 | #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS | 
|  | 468 | #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS | 
|  | 469 | #define _LIBCPP_HAS_NO_NULLPTR | 
|  | 470 | #define _LIBCPP_HAS_NO_STATIC_ASSERT | 
|  | 471 | #define _LIBCPP_HAS_NO_UNICODE_CHARS | 
|  | 472 | #define _LIBCPP_HAS_NO_VARIADICS | 
| Howard Hinnant | 7609c9b | 2010-09-04 23:28:19 +0000 | [diff] [blame] | 473 | #define _LIBCPP_HAS_NO_RVALUE_REFERENCES | 
| Howard Hinnant | 9d06c8c | 2011-04-21 14:29:59 +0000 | [diff] [blame] | 474 | #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS | 
| Logan Chien | ca83921 | 2013-12-14 06:44:09 +0000 | [diff] [blame] | 475 | #define _LIBCPP_HAS_NO_STRONG_ENUMS | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 476 |  | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 477 | #else  // __GXX_EXPERIMENTAL_CXX0X__ | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 478 |  | 
| Howard Hinnant | c4931c4 | 2010-11-16 21:10:23 +0000 | [diff] [blame] | 479 | #define _LIBCPP_HAS_NO_TRAILING_RETURN | 
| Howard Hinnant | 9d06c8c | 2011-04-21 14:29:59 +0000 | [diff] [blame] | 480 | #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS | 
| Howard Hinnant | c4931c4 | 2010-11-16 21:10:23 +0000 | [diff] [blame] | 481 |  | 
| Howard Hinnant | f543a75 | 2012-10-03 20:48:05 +0000 | [diff] [blame] | 482 | #if _GNUC_VER < 403 | 
| Howard Hinnant | 7609c9b | 2010-09-04 23:28:19 +0000 | [diff] [blame] | 483 | #define _LIBCPP_HAS_NO_RVALUE_REFERENCES | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 484 | #endif | 
|  | 485 |  | 
| Howard Hinnant | f543a75 | 2012-10-03 20:48:05 +0000 | [diff] [blame] | 486 | #if _GNUC_VER < 403 | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 487 | #define _LIBCPP_HAS_NO_STATIC_ASSERT | 
|  | 488 | #endif | 
|  | 489 |  | 
| Howard Hinnant | f543a75 | 2012-10-03 20:48:05 +0000 | [diff] [blame] | 490 | #if _GNUC_VER < 404 | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 491 | #define _LIBCPP_HAS_NO_DECLTYPE | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 492 | #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS | 
|  | 493 | #define _LIBCPP_HAS_NO_UNICODE_CHARS | 
|  | 494 | #define _LIBCPP_HAS_NO_VARIADICS | 
| Howard Hinnant | 54976f2 | 2011-08-12 21:56:02 +0000 | [diff] [blame] | 495 | #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS | 
| Howard Hinnant | f543a75 | 2012-10-03 20:48:05 +0000 | [diff] [blame] | 496 | #endif  // _GNUC_VER < 404 | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 497 |  | 
| Howard Hinnant | f543a75 | 2012-10-03 20:48:05 +0000 | [diff] [blame] | 498 | #if _GNUC_VER < 406 | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 499 | #define _LIBCPP_HAS_NO_NULLPTR | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 500 | #endif | 
|  | 501 |  | 
| Yaron Keren | e050d66 | 2013-11-22 09:22:12 +0000 | [diff] [blame] | 502 | #if _GNUC_VER < 407 | 
|  | 503 | #define _LIBCPP_HAS_NO_ADVANCED_SFINAE | 
|  | 504 | #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS | 
|  | 505 | #endif | 
|  | 506 |  | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 507 | #endif  // __GXX_EXPERIMENTAL_CXX0X__ | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 508 |  | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 509 | #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { namespace _LIBCPP_NAMESPACE { | 
|  | 510 | #define _LIBCPP_END_NAMESPACE_STD  } } | 
| Howard Hinnant | ce48a11 | 2011-06-30 21:18:19 +0000 | [diff] [blame] | 511 | #define _VSTD std::_LIBCPP_NAMESPACE | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 512 |  | 
|  | 513 | namespace std { | 
|  | 514 | namespace _LIBCPP_NAMESPACE { | 
|  | 515 | } | 
|  | 516 | using namespace _LIBCPP_NAMESPACE __attribute__((__strong__)); | 
|  | 517 | } | 
|  | 518 |  | 
| Marshall Clow | 91c71dd | 2014-04-14 15:44:57 +0000 | [diff] [blame] | 519 | #if !defined(_LIBCPP_HAS_NO_ASAN) && !defined(__SANITIZE_ADDRESS__) | 
|  | 520 | #define _LIBCPP_HAS_NO_ASAN | 
|  | 521 | #endif | 
|  | 522 |  | 
| Howard Hinnant | 0be8f64 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 523 | #elif defined(_LIBCPP_MSVC) | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 524 |  | 
| Howard Hinnant | e438337 | 2011-10-22 20:59:45 +0000 | [diff] [blame] | 525 | #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 526 | #define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER | 
|  | 527 | #define _LIBCPP_HAS_NO_CONSTEXPR | 
| Eric Fiselier | 371aac1 | 2014-07-17 05:16:18 +0000 | [diff] [blame] | 528 | #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR | 
| Marshall Clow | 2d832d2 | 2015-03-17 15:30:22 +0000 | [diff] [blame] | 529 | #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 530 | #define _LIBCPP_HAS_NO_UNICODE_CHARS | 
|  | 531 | #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS | 
| Howard Hinnant | c9d3ae4 | 2013-08-24 21:31:37 +0000 | [diff] [blame] | 532 | #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 533 | #define __alignof__ __alignof | 
| Richard Smith | 535a86c | 2012-07-26 02:04:22 +0000 | [diff] [blame] | 534 | #define _LIBCPP_NORETURN __declspec(noreturn) | 
| Dimitry Andric | b1e78df | 2015-02-05 07:40:48 +0000 | [diff] [blame] | 535 | #define _LIBCPP_UNUSED | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 536 | #define _ALIGNAS(x) __declspec(align(x)) | 
|  | 537 | #define _LIBCPP_HAS_NO_VARIADICS | 
|  | 538 |  | 
| Yaron Keren | 3ef24c4 | 2014-02-13 14:02:28 +0000 | [diff] [blame] | 539 | #define _NOEXCEPT throw () | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 540 | #define _NOEXCEPT_(x) | 
| Marshall Clow | d41295da | 2014-01-03 18:21:14 +0000 | [diff] [blame] | 541 | #define _NOEXCEPT_OR_FALSE(x) false | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 542 |  | 
|  | 543 | #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std { | 
|  | 544 | #define _LIBCPP_END_NAMESPACE_STD  } | 
|  | 545 | #define _VSTD std | 
|  | 546 |  | 
| Howard Hinnant | a942f2f | 2013-10-04 23:56:37 +0000 | [diff] [blame] | 547 | #  define _LIBCPP_WEAK | 
| Howard Hinnant | 073458b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 548 | namespace std { | 
|  | 549 | } | 
|  | 550 |  | 
| Marshall Clow | 91c71dd | 2014-04-14 15:44:57 +0000 | [diff] [blame] | 551 | #define _LIBCPP_HAS_NO_ASAN | 
|  | 552 |  | 
| Howard Hinnant | 5d1a701 | 2013-08-14 18:00:20 +0000 | [diff] [blame] | 553 | #elif defined(__IBMCPP__) | 
|  | 554 |  | 
|  | 555 | #define _ALIGNAS(x) __attribute__((__aligned__(x))) | 
|  | 556 | #define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) | 
|  | 557 | #define _ATTRIBUTE(x) __attribute__((x)) | 
|  | 558 | #define _LIBCPP_NORETURN __attribute__((noreturn)) | 
| Dimitry Andric | b1e78df | 2015-02-05 07:40:48 +0000 | [diff] [blame] | 559 | #define _LIBCPP_UNUSED | 
| Howard Hinnant | 5d1a701 | 2013-08-14 18:00:20 +0000 | [diff] [blame] | 560 |  | 
|  | 561 | #define _NOEXCEPT throw() | 
|  | 562 | #define _NOEXCEPT_(x) | 
| Marshall Clow | d41295da | 2014-01-03 18:21:14 +0000 | [diff] [blame] | 563 | #define _NOEXCEPT_OR_FALSE(x) false | 
| Howard Hinnant | 5d1a701 | 2013-08-14 18:00:20 +0000 | [diff] [blame] | 564 |  | 
|  | 565 | #define _LIBCPP_HAS_NO_TEMPLATE_ALIASES | 
|  | 566 | #define _LIBCPP_HAS_NO_ADVANCED_SFINAE | 
|  | 567 | #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS | 
|  | 568 | #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS | 
|  | 569 | #define _LIBCPP_HAS_NO_NULLPTR | 
|  | 570 | #define _LIBCPP_HAS_NO_UNICODE_CHARS | 
| Howard Hinnant | 5d1a701 | 2013-08-14 18:00:20 +0000 | [diff] [blame] | 571 | #define _LIBCPP_HAS_IS_BASE_OF | 
| Eric Fiselier | ee187e2 | 2015-06-13 07:08:02 +0000 | [diff] [blame] | 572 | #define _LIBCPP_HAS_IS_FINAL | 
| Marshall Clow | 2d832d2 | 2015-03-17 15:30:22 +0000 | [diff] [blame] | 573 | #define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES | 
| Howard Hinnant | 5d1a701 | 2013-08-14 18:00:20 +0000 | [diff] [blame] | 574 |  | 
|  | 575 | #if defined(_AIX) | 
|  | 576 | #define __MULTILOCALE_API | 
|  | 577 | #endif | 
|  | 578 |  | 
|  | 579 | #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE { | 
|  | 580 | #define _LIBCPP_END_NAMESPACE_STD  } } | 
|  | 581 | #define _VSTD std::_LIBCPP_NAMESPACE | 
|  | 582 |  | 
|  | 583 | namespace std { | 
|  | 584 | inline namespace _LIBCPP_NAMESPACE { | 
|  | 585 | } | 
|  | 586 | } | 
|  | 587 |  | 
| Marshall Clow | 91c71dd | 2014-04-14 15:44:57 +0000 | [diff] [blame] | 588 | #define _LIBCPP_HAS_NO_ASAN | 
|  | 589 |  | 
| Marshall Clow | a889636 | 2014-01-06 15:23:02 +0000 | [diff] [blame] | 590 | #endif // __clang__ || __GNUC__ || _MSC_VER || __IBMCPP__ | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 591 |  | 
|  | 592 | #ifdef _LIBCPP_HAS_NO_UNICODE_CHARS | 
| Howard Hinnant | eb26925 | 2010-08-10 20:48:29 +0000 | [diff] [blame] | 593 | typedef unsigned short char16_t; | 
|  | 594 | typedef unsigned int   char32_t; | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 595 | #endif  // _LIBCPP_HAS_NO_UNICODE_CHARS | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 596 |  | 
| Stephan Tolksdorf | e180eca | 2014-03-26 19:45:52 +0000 | [diff] [blame] | 597 | #ifndef __SIZEOF_INT128__ | 
|  | 598 | #define _LIBCPP_HAS_NO_INT128 | 
|  | 599 | #endif | 
|  | 600 |  | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 601 | #ifdef _LIBCPP_HAS_NO_STATIC_ASSERT | 
|  | 602 |  | 
| Richard Smith | f157e47 | 2015-10-13 23:12:22 +0000 | [diff] [blame] | 603 | extern "C++" { | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 604 | template <bool> struct __static_assert_test; | 
|  | 605 | template <> struct __static_assert_test<true> {}; | 
|  | 606 | template <unsigned> struct __static_assert_check {}; | 
| Richard Smith | f157e47 | 2015-10-13 23:12:22 +0000 | [diff] [blame] | 607 | } | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 608 | #define static_assert(__b, __m) \ | 
|  | 609 | typedef __static_assert_check<sizeof(__static_assert_test<(__b)>)> \ | 
|  | 610 | _LIBCPP_CONCAT(__t, __LINE__) | 
|  | 611 |  | 
| Howard Hinnant | b3371f6 | 2010-08-22 00:02:43 +0000 | [diff] [blame] | 612 | #endif  // _LIBCPP_HAS_NO_STATIC_ASSERT | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 613 |  | 
|  | 614 | #ifdef _LIBCPP_HAS_NO_DECLTYPE | 
| Eric Fiselier | e825d8b | 2015-07-10 20:26:38 +0000 | [diff] [blame] | 615 | // GCC 4.6 provides __decltype in all standard modes. | 
|  | 616 | #if !__is_identifier(__decltype) || _GNUC_VER >= 406 | 
| Eric Fiselier | f817754 | 2015-06-13 06:27:17 +0000 | [diff] [blame] | 617 | #  define decltype(__x) __decltype(__x) | 
|  | 618 | #else | 
|  | 619 | #  define decltype(__x) __typeof__(__x) | 
|  | 620 | #endif | 
| Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 621 | #endif | 
|  | 622 |  | 
| Howard Hinnant | db3e997 | 2010-09-06 19:10:31 +0000 | [diff] [blame] | 623 | #ifdef _LIBCPP_HAS_NO_CONSTEXPR | 
| Howard Hinnant | 788c997 | 2012-04-02 00:40:41 +0000 | [diff] [blame] | 624 | #define _LIBCPP_CONSTEXPR | 
|  | 625 | #else | 
|  | 626 | #define _LIBCPP_CONSTEXPR constexpr | 
| Howard Hinnant | db3e997 | 2010-09-06 19:10:31 +0000 | [diff] [blame] | 627 | #endif | 
|  | 628 |  | 
| Howard Hinnant | da9ca0b | 2013-05-02 20:18:43 +0000 | [diff] [blame] | 629 | #ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS | 
|  | 630 | #define _LIBCPP_DEFAULT {} | 
|  | 631 | #else | 
|  | 632 | #define _LIBCPP_DEFAULT = default; | 
|  | 633 | #endif | 
|  | 634 |  | 
| Nuno Lopes | 6317bfb | 2012-06-28 16:47:34 +0000 | [diff] [blame] | 635 | #ifdef __GNUC__ | 
| Joerg Sonnenberger | 21883e9 | 2013-04-29 19:52:08 +0000 | [diff] [blame] | 636 | #define _NOALIAS __attribute__((__malloc__)) | 
| Nuno Lopes | 6317bfb | 2012-06-28 16:47:34 +0000 | [diff] [blame] | 637 | #else | 
|  | 638 | #define _NOALIAS | 
|  | 639 | #endif | 
|  | 640 |  | 
| Marshall Clow | 028875a | 2013-11-19 19:16:03 +0000 | [diff] [blame] | 641 | #if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) | 
| Howard Hinnant | f2f2d8b | 2012-02-21 21:46:43 +0000 | [diff] [blame] | 642 | #   define _LIBCPP_EXPLICIT explicit | 
|  | 643 | #else | 
|  | 644 | #   define _LIBCPP_EXPLICIT | 
|  | 645 | #endif | 
|  | 646 |  | 
| Richard Smith | ff0aff3 | 2014-06-04 19:54:15 +0000 | [diff] [blame] | 647 | #if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete) | 
|  | 648 | #   define _LIBCPP_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE | 
|  | 649 | #endif | 
|  | 650 |  | 
| Howard Hinnant | 75689c1 | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 651 | #ifdef _LIBCPP_HAS_NO_STRONG_ENUMS | 
| Howard Hinnant | 6e41256 | 2013-03-06 23:30:19 +0000 | [diff] [blame] | 652 | #define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx | 
| Howard Hinnant | 75689c1 | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 653 | #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ | 
| Howard Hinnant | 54d333a | 2012-10-30 19:06:59 +0000 | [diff] [blame] | 654 | __lx __v_; \ | 
|  | 655 | _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \ | 
|  | 656 | _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \ | 
| Howard Hinnant | 75689c1 | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 657 | _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ | 
|  | 658 | }; | 
|  | 659 | #else  // _LIBCPP_HAS_NO_STRONG_ENUMS | 
| Howard Hinnant | 6e41256 | 2013-03-06 23:30:19 +0000 | [diff] [blame] | 660 | #define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x | 
| Howard Hinnant | 75689c1 | 2011-12-02 19:36:40 +0000 | [diff] [blame] | 661 | #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) | 
|  | 662 | #endif  // _LIBCPP_HAS_NO_STRONG_ENUMS | 
|  | 663 |  | 
| Howard Hinnant | 145afa1 | 2013-08-23 20:10:18 +0000 | [diff] [blame] | 664 | #ifdef _LIBCPP_DEBUG | 
|  | 665 | #   if _LIBCPP_DEBUG == 0 | 
| Howard Hinnant | fc88dbd | 2013-08-23 17:37:05 +0000 | [diff] [blame] | 666 | #       define _LIBCPP_DEBUG_LEVEL 1 | 
| Howard Hinnant | 145afa1 | 2013-08-23 20:10:18 +0000 | [diff] [blame] | 667 | #   elif _LIBCPP_DEBUG == 1 | 
| Howard Hinnant | fc88dbd | 2013-08-23 17:37:05 +0000 | [diff] [blame] | 668 | #       define _LIBCPP_DEBUG_LEVEL 2 | 
|  | 669 | #   else | 
| Howard Hinnant | 145afa1 | 2013-08-23 20:10:18 +0000 | [diff] [blame] | 670 | #       error Supported values for _LIBCPP_DEBUG are 0 and 1 | 
| Howard Hinnant | fc88dbd | 2013-08-23 17:37:05 +0000 | [diff] [blame] | 671 | #   endif | 
|  | 672 | #   define _LIBCPP_EXTERN_TEMPLATE(...) | 
|  | 673 | #endif | 
|  | 674 |  | 
| Howard Hinnant | cd47cbc | 2012-11-06 21:08:48 +0000 | [diff] [blame] | 675 | #ifndef _LIBCPP_EXTERN_TEMPLATE | 
| Justin Bogner | d2308ea | 2014-08-15 17:58:56 +0000 | [diff] [blame] | 676 | #define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; | 
| Howard Hinnant | cd47cbc | 2012-11-06 21:08:48 +0000 | [diff] [blame] | 677 | #endif | 
|  | 678 |  | 
| Howard Hinnant | fc88dbd | 2013-08-23 17:37:05 +0000 | [diff] [blame] | 679 | #ifndef _LIBCPP_EXTERN_TEMPLATE2 | 
|  | 680 | #define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__; | 
|  | 681 | #endif | 
|  | 682 |  | 
| Tim Northover | 4b9a505 | 2014-03-30 14:59:12 +0000 | [diff] [blame] | 683 | #if defined(__APPLE__) && defined(__LP64__) && !defined(__x86_64__) | 
| Tim Northover | 0090e65 | 2014-03-30 11:34:26 +0000 | [diff] [blame] | 684 | #define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63) | 
|  | 685 | #endif | 
|  | 686 |  | 
| Ed Schouten | 510b6ab | 2015-03-10 09:26:38 +0000 | [diff] [blame] | 687 | #if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || \ | 
|  | 688 | defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__) | 
| Alexis Hunt | 4084c9e | 2011-07-15 05:40:33 +0000 | [diff] [blame] | 689 | #define _LIBCPP_LOCALE__L_EXTENSIONS 1 | 
|  | 690 | #endif | 
| Yaron Keren | 21a697b8 | 2013-12-20 13:19:45 +0000 | [diff] [blame] | 691 |  | 
| Ed Schouten | 12e0126 | 2015-03-11 16:39:36 +0000 | [diff] [blame] | 692 | #if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) && \ | 
|  | 693 | !defined(__CloudABI__) | 
|  | 694 | #define _LIBCPP_HAS_CATOPEN 1 | 
|  | 695 | #endif | 
|  | 696 |  | 
| Marshall Clow | 69e76f8 | 2013-03-18 19:34:07 +0000 | [diff] [blame] | 697 | #ifdef __FreeBSD__ | 
| David Chisnall | 5e8e044 | 2011-11-13 17:15:33 +0000 | [diff] [blame] | 698 | #define _DECLARE_C99_LDBL_MATH 1 | 
|  | 699 | #endif | 
| Alexis Hunt | 4084c9e | 2011-07-15 05:40:33 +0000 | [diff] [blame] | 700 |  | 
| Marshall Clow | 69e76f8 | 2013-03-18 19:34:07 +0000 | [diff] [blame] | 701 | #if defined(__APPLE__) || defined(__FreeBSD__) | 
| Howard Hinnant | 9978e37 | 2011-09-28 23:39:33 +0000 | [diff] [blame] | 702 | #define _LIBCPP_HAS_DEFAULTRUNELOCALE | 
| Alexis Hunt | f023519 | 2011-07-09 01:09:31 +0000 | [diff] [blame] | 703 | #endif | 
|  | 704 |  | 
| Marshall Clow | 69e76f8 | 2013-03-18 19:34:07 +0000 | [diff] [blame] | 705 | #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__) | 
| Alexis Hunt | 0081892 | 2011-07-09 03:40:04 +0000 | [diff] [blame] | 706 | #define _LIBCPP_WCTYPE_IS_MASK | 
|  | 707 | #endif | 
|  | 708 |  | 
| Howard Hinnant | f9fd0d6 | 2013-11-14 22:52:25 +0000 | [diff] [blame] | 709 | #ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR | 
|  | 710 | #  define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1 | 
|  | 711 | #endif | 
|  | 712 |  | 
| Howard Hinnant | 81aa5cb | 2013-05-07 20:16:13 +0000 | [diff] [blame] | 713 | #ifndef _LIBCPP_STD_VER | 
|  | 714 | #  if  __cplusplus <= 201103L | 
|  | 715 | #    define _LIBCPP_STD_VER 11 | 
| Marshall Clow | c369914 | 2014-06-06 22:31:09 +0000 | [diff] [blame] | 716 | #  elif __cplusplus <= 201402L | 
|  | 717 | #    define _LIBCPP_STD_VER 14 | 
| Howard Hinnant | 81aa5cb | 2013-05-07 20:16:13 +0000 | [diff] [blame] | 718 | #  else | 
| Marshall Clow | c369914 | 2014-06-06 22:31:09 +0000 | [diff] [blame] | 719 | #    define _LIBCPP_STD_VER 15  // current year, or date of c++17 ratification | 
| Howard Hinnant | 81aa5cb | 2013-05-07 20:16:13 +0000 | [diff] [blame] | 720 | #  endif | 
|  | 721 | #endif  // _LIBCPP_STD_VER | 
|  | 722 |  | 
| Marshall Clow | 8392ab2 | 2013-09-28 18:35:31 +0000 | [diff] [blame] | 723 | #if _LIBCPP_STD_VER > 11 | 
|  | 724 | #define _LIBCPP_DEPRECATED [[deprecated]] | 
|  | 725 | #else | 
|  | 726 | #define _LIBCPP_DEPRECATED | 
|  | 727 | #endif | 
|  | 728 |  | 
| Marshall Clow | f20d267 | 2013-07-15 14:57:19 +0000 | [diff] [blame] | 729 | #if _LIBCPP_STD_VER <= 11 | 
| Marshall Clow | 7988106b | 2013-08-27 20:18:59 +0000 | [diff] [blame] | 730 | #define _LIBCPP_EXPLICIT_AFTER_CXX11 | 
| Marshall Clow | 8392ab2 | 2013-09-28 18:35:31 +0000 | [diff] [blame] | 731 | #define _LIBCPP_DEPRECATED_AFTER_CXX11 | 
| Marshall Clow | f20d267 | 2013-07-15 14:57:19 +0000 | [diff] [blame] | 732 | #else | 
| Marshall Clow | 7988106b | 2013-08-27 20:18:59 +0000 | [diff] [blame] | 733 | #define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit | 
| Marshall Clow | 8392ab2 | 2013-09-28 18:35:31 +0000 | [diff] [blame] | 734 | #define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]] | 
| Marshall Clow | f20d267 | 2013-07-15 14:57:19 +0000 | [diff] [blame] | 735 | #endif | 
|  | 736 |  | 
| Eric Fiselier | 371aac1 | 2014-07-17 05:16:18 +0000 | [diff] [blame] | 737 | #if _LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR) | 
|  | 738 | #define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr | 
|  | 739 | #else | 
|  | 740 | #define _LIBCPP_CONSTEXPR_AFTER_CXX11 | 
|  | 741 | #endif | 
|  | 742 |  | 
| Dimitry Andric | 251c629 | 2015-08-19 06:43:33 +0000 | [diff] [blame] | 743 | #ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES | 
|  | 744 | #  define _LIBCPP_EXPLICIT_MOVE(x) _VSTD::move(x) | 
|  | 745 | #else | 
|  | 746 | #  define _LIBCPP_EXPLICIT_MOVE(x) (x) | 
|  | 747 | #endif | 
|  | 748 |  | 
| Marshall Clow | 5c520bd | 2014-05-08 14:14:06 +0000 | [diff] [blame] | 749 | #ifndef _LIBCPP_HAS_NO_ASAN | 
|  | 750 | extern "C" void __sanitizer_annotate_contiguous_container( | 
|  | 751 | const void *, const void *, const void *, const void *); | 
|  | 752 | #endif | 
|  | 753 |  | 
| Howard Hinnant | f7a8c4f | 2013-10-04 21:24:21 +0000 | [diff] [blame] | 754 | // Try to find out if RTTI is disabled. | 
|  | 755 | // g++ and cl.exe have RTTI on by default and define a macro when it is. | 
|  | 756 | // g++ only defines the macro in 4.3.2 and onwards. | 
|  | 757 | #if !defined(_LIBCPP_NO_RTTI) | 
| Marshall Clow | 286a74e | 2015-09-22 21:58:30 +0000 | [diff] [blame] | 758 | #  if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \ | 
| Alexey Volkov | e46ca71 | 2014-09-03 14:30:39 +0000 | [diff] [blame] | 759 | (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI) | 
| Howard Hinnant | f7a8c4f | 2013-10-04 21:24:21 +0000 | [diff] [blame] | 760 | #    define _LIBCPP_NO_RTTI | 
|  | 761 | #  elif (defined(_MSC_VER) && !defined(__clang__)) && !defined(_CPPRTTI) | 
|  | 762 | #    define _LIBCPP_NO_RTTI | 
|  | 763 | #  endif | 
|  | 764 | #endif | 
|  | 765 |  | 
| Howard Hinnant | a942f2f | 2013-10-04 23:56:37 +0000 | [diff] [blame] | 766 | #ifndef _LIBCPP_WEAK | 
|  | 767 | #  define _LIBCPP_WEAK __attribute__((__weak__)) | 
|  | 768 | #endif | 
|  | 769 |  | 
| Eric Fiselier | 2050bed | 2014-12-06 20:09:11 +0000 | [diff] [blame] | 770 | #if defined(_LIBCPP_HAS_NO_MONOTONIC_CLOCK) && !defined(_LIBCPP_HAS_NO_THREADS) | 
|  | 771 | #  error _LIBCPP_HAS_NO_MONOTONIC_CLOCK may only be defined when \ | 
|  | 772 | _LIBCPP_HAS_NO_THREADS is defined. | 
|  | 773 | #endif | 
|  | 774 |  | 
| Ed Schouten | 97fdea6 | 2015-03-12 15:44:39 +0000 | [diff] [blame] | 775 | // Systems that use capability-based security (FreeBSD with Capsicum, | 
|  | 776 | // Nuxi CloudABI) may only provide local filesystem access (using *at()). | 
|  | 777 | // Functions like open(), rename(), unlink() and stat() should not be | 
|  | 778 | // used, as they attempt to access the global filesystem namespace. | 
|  | 779 | #ifdef __CloudABI__ | 
|  | 780 | #define _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE | 
|  | 781 | #endif | 
|  | 782 |  | 
| Ed Schouten | f4ac884 | 2015-03-26 14:35:46 +0000 | [diff] [blame] | 783 | // CloudABI is intended for running networked services. Processes do not | 
|  | 784 | // have standard input and output channels. | 
|  | 785 | #ifdef __CloudABI__ | 
|  | 786 | #define _LIBCPP_HAS_NO_STDIN | 
|  | 787 | #define _LIBCPP_HAS_NO_STDOUT | 
|  | 788 | #endif | 
|  | 789 |  | 
| Ed Schouten | 637a686 | 2015-03-12 15:48:06 +0000 | [diff] [blame] | 790 | #if defined(__ANDROID__) || defined(__CloudABI__) | 
| Dan Albert | 900086d | 2015-03-11 00:51:06 +0000 | [diff] [blame] | 791 | #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE | 
|  | 792 | #endif | 
|  | 793 |  | 
| Ed Schouten | e0cf3b9 | 2015-06-24 08:44:38 +0000 | [diff] [blame] | 794 | // Thread-unsafe functions such as strtok(), mbtowc() and localtime() | 
|  | 795 | // are not available. | 
|  | 796 | #ifdef __CloudABI__ | 
|  | 797 | #define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS | 
|  | 798 | #endif | 
|  | 799 |  | 
| Eric Fiselier | 927a11e | 2015-09-22 03:15:35 +0000 | [diff] [blame] | 800 | #if __has_feature(cxx_atomic) || __has_extension(c_atomic) | 
| Eric Fiselier | 749adeb | 2015-08-19 17:21:46 +0000 | [diff] [blame] | 801 | #define _LIBCPP_HAS_C_ATOMIC_IMP | 
|  | 802 | #elif _GNUC_VER > 407 | 
|  | 803 | #define _LIBCPP_HAS_GCC_ATOMIC_IMP | 
|  | 804 | #endif | 
|  | 805 |  | 
|  | 806 | #if (!defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)) \ | 
|  | 807 | || defined(_LIBCPP_HAS_NO_THREADS) | 
|  | 808 | #define _LIBCPP_HAS_NO_ATOMIC_HEADER | 
|  | 809 | #endif | 
|  | 810 |  | 
|  | 811 | #endif // _LIBCPP_CONFIG |