OLD | NEW |
1 // -*- C++ -*- | 1 // -*- C++ -*- |
2 //===----------------------------------------------------------------------===// | 2 //===----------------------------------------------------------------------===// |
3 // | 3 // |
4 // The LLVM Compiler Infrastructure | 4 // The LLVM Compiler Infrastructure |
5 // | 5 // |
6 // This file is dual licensed under the MIT and the University of Illinois Open | 6 // This file is dual licensed under the MIT and the University of Illinois Open |
7 // Source Licenses. See LICENSE.TXT for details. | 7 // Source Licenses. See LICENSE.TXT for details. |
8 // | 8 // |
9 //===----------------------------------------------------------------------===// | 9 //===----------------------------------------------------------------------===// |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 #elif defined(_AIX) | 24 #elif defined(_AIX) |
25 # include <support/ibm/xlocale.h> | 25 # include <support/ibm/xlocale.h> |
26 #elif defined(__ANDROID__) | 26 #elif defined(__ANDROID__) |
27 // Android gained the locale aware functions in L (API level 21) | 27 // Android gained the locale aware functions in L (API level 21) |
28 # include <android/api-level.h> | 28 # include <android/api-level.h> |
29 # if __ANDROID_API__ <= 20 | 29 # if __ANDROID_API__ <= 20 |
30 # include <support/android/locale_bionic.h> | 30 # include <support/android/locale_bionic.h> |
31 # endif | 31 # endif |
32 #elif defined(__sun__) | 32 #elif defined(__sun__) |
33 # include <support/solaris/xlocale.h> | 33 # include <support/solaris/xlocale.h> |
| 34 // @LOCALMOD-START |
| 35 #elif defined(_NEWLIB_VERSION) |
| 36 // FIXME: replace all the uses of _NEWLIB_VERSION with __NEWLIB__ preceded by an |
| 37 // include of <sys/cdefs.h> once https://sourceware.org/ml/newlib-cvs/2014-q3/ms
g00038.html |
| 38 // has had a chance to bake for a bit. |
| 39 #include <support/newlib/xlocale.h> |
| 40 // @LOCALMOD-END |
34 #elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ | 41 #elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ |
35 || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) | 42 || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) |
36 # include <xlocale.h> | 43 # include <xlocale.h> |
37 #endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ ||
__IBMCPP__ | 44 #endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ ||
__IBMCPP__ |
38 | 45 |
39 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | 46 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
40 #pragma GCC system_header | 47 #pragma GCC system_header |
41 #endif | 48 #endif |
42 | 49 |
43 _LIBCPP_BEGIN_NAMESPACE_STD | 50 _LIBCPP_BEGIN_NAMESPACE_STD |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 static const mask space = _ISSPACE; | 391 static const mask space = _ISSPACE; |
385 static const mask print = _ISPRINT; | 392 static const mask print = _ISPRINT; |
386 static const mask cntrl = _ISCNTRL; | 393 static const mask cntrl = _ISCNTRL; |
387 static const mask upper = _ISUPPER; | 394 static const mask upper = _ISUPPER; |
388 static const mask lower = _ISLOWER; | 395 static const mask lower = _ISLOWER; |
389 static const mask alpha = _ISALPHA; | 396 static const mask alpha = _ISALPHA; |
390 static const mask digit = _ISDIGIT; | 397 static const mask digit = _ISDIGIT; |
391 static const mask punct = _ISPUNCT; | 398 static const mask punct = _ISPUNCT; |
392 static const mask xdigit = _ISXDIGIT; | 399 static const mask xdigit = _ISXDIGIT; |
393 static const mask blank = _ISBLANK; | 400 static const mask blank = _ISBLANK; |
| 401 // @LOCALMOD-START |
| 402 #elif defined(_NEWLIB_VERSION) |
| 403 typedef char mask; // Same type as Newlib's _ctype_ array in ctype.h. |
| 404 // Defined in Newlib's ctype.h. |
| 405 static const mask space = _S; |
| 406 static const mask print = _P | _U | _L | _N | _B; |
| 407 static const mask cntrl = _C; |
| 408 static const mask upper = _U; |
| 409 static const mask lower = _L; |
| 410 static const mask alpha = _U | _L; |
| 411 static const mask digit = _N; |
| 412 static const mask punct = _P; |
| 413 static const mask xdigit = _X | _N; |
| 414 static const mask blank = _B; |
| 415 // @LOCALMOD-END |
394 #else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || __EMSCRIPTEN__ || _
_sun__ | 416 #else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || __EMSCRIPTEN__ || _
_sun__ |
395 typedef unsigned long mask; | 417 typedef unsigned long mask; |
396 static const mask space = 1<<0; | 418 static const mask space = 1<<0; |
397 static const mask print = 1<<1; | 419 static const mask print = 1<<1; |
398 static const mask cntrl = 1<<2; | 420 static const mask cntrl = 1<<2; |
399 static const mask upper = 1<<3; | 421 static const mask upper = 1<<3; |
400 static const mask lower = 1<<4; | 422 static const mask lower = 1<<4; |
401 static const mask alpha = 1<<5; | 423 static const mask alpha = 1<<5; |
402 static const mask digit = 1<<6; | 424 static const mask digit = 1<<6; |
403 static const mask punct = 1<<7; | 425 static const mask punct = 1<<7; |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 protected: | 1474 protected: |
1453 ~numpunct_byname(); | 1475 ~numpunct_byname(); |
1454 | 1476 |
1455 private: | 1477 private: |
1456 void __init(const char*); | 1478 void __init(const char*); |
1457 }; | 1479 }; |
1458 | 1480 |
1459 _LIBCPP_END_NAMESPACE_STD | 1481 _LIBCPP_END_NAMESPACE_STD |
1460 | 1482 |
1461 #endif // _LIBCPP___LOCALE | 1483 #endif // _LIBCPP___LOCALE |
OLD | NEW |