| 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 23 matching lines...) Expand all Loading... |
| 34 // @LOCALMOD-START | 34 // @LOCALMOD-START |
| 35 #elif defined(_NEWLIB_VERSION) | 35 #elif defined(_NEWLIB_VERSION) |
| 36 // FIXME: replace all the uses of _NEWLIB_VERSION with __NEWLIB__ preceded by an | 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 | 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. | 38 // has had a chance to bake for a bit. |
| 39 #include <support/newlib/xlocale.h> | 39 #include <support/newlib/xlocale.h> |
| 40 // @LOCALMOD-END | 40 // @LOCALMOD-END |
| 41 #elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ | 41 #elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ |
| 42 || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) | 42 || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) |
| 43 # include <xlocale.h> | 43 # include <xlocale.h> |
| 44 #elif defined(_LIBCPP_HAS_MUSL_LIBC) |
| 45 # include <support/musl/xlocale.h> |
| 44 #endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ ||
__IBMCPP__ | 46 #endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ ||
__IBMCPP__ |
| 45 | 47 |
| 46 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | 48 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
| 47 #pragma GCC system_header | 49 #pragma GCC system_header |
| 48 #endif | 50 #endif |
| 49 | 51 |
| 50 _LIBCPP_BEGIN_NAMESPACE_STD | 52 _LIBCPP_BEGIN_NAMESPACE_STD |
| 51 | 53 |
| 52 class _LIBCPP_TYPE_VIS locale; | 54 class _LIBCPP_TYPE_VIS locale; |
| 53 | 55 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 return _VSTD::use_facet<_VSTD::collate<_CharT> >(*this).compare( | 328 return _VSTD::use_facet<_VSTD::collate<_CharT> >(*this).compare( |
| 327 __x.data(), __x.data() + __x.size(), | 329 __x.data(), __x.data() + __x.size(), |
| 328 __y.data(), __y.data() + __y.size()) < 0; | 330 __y.data(), __y.data() + __y.size()) < 0; |
| 329 } | 331 } |
| 330 | 332 |
| 331 // template <class charT> class ctype | 333 // template <class charT> class ctype |
| 332 | 334 |
| 333 class _LIBCPP_TYPE_VIS ctype_base | 335 class _LIBCPP_TYPE_VIS ctype_base |
| 334 { | 336 { |
| 335 public: | 337 public: |
| 336 #ifdef __GLIBC__ | 338 #if defined(__GLIBC__) |
| 337 typedef unsigned short mask; | 339 typedef unsigned short mask; |
| 338 static const mask space = _ISspace; | 340 static const mask space = _ISspace; |
| 339 static const mask print = _ISprint; | 341 static const mask print = _ISprint; |
| 340 static const mask cntrl = _IScntrl; | 342 static const mask cntrl = _IScntrl; |
| 341 static const mask upper = _ISupper; | 343 static const mask upper = _ISupper; |
| 342 static const mask lower = _ISlower; | 344 static const mask lower = _ISlower; |
| 343 static const mask alpha = _ISalpha; | 345 static const mask alpha = _ISalpha; |
| 344 static const mask digit = _ISdigit; | 346 static const mask digit = _ISdigit; |
| 345 static const mask punct = _ISpunct; | 347 static const mask punct = _ISpunct; |
| 346 static const mask xdigit = _ISxdigit; | 348 static const mask xdigit = _ISxdigit; |
| 347 static const mask blank = _ISblank; | 349 static const mask blank = _ISblank; |
| 348 #elif defined(_WIN32) | 350 #elif defined(_WIN32) |
| 349 typedef unsigned short mask; | 351 typedef unsigned short mask; |
| 350 static const mask space = _SPACE; | 352 static const mask space = _SPACE; |
| 351 static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT; | 353 static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT; |
| 352 static const mask cntrl = _CONTROL; | 354 static const mask cntrl = _CONTROL; |
| 353 static const mask upper = _UPPER; | 355 static const mask upper = _UPPER; |
| 354 static const mask lower = _LOWER; | 356 static const mask lower = _LOWER; |
| 355 static const mask alpha = _ALPHA; | 357 static const mask alpha = _ALPHA; |
| 356 static const mask digit = _DIGIT; | 358 static const mask digit = _DIGIT; |
| 357 static const mask punct = _PUNCT; | 359 static const mask punct = _PUNCT; |
| 358 static const mask xdigit = _HEX; | 360 static const mask xdigit = _HEX; |
| 359 static const mask blank = _BLANK; | 361 static const mask blank = _BLANK; |
| 360 #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || d
efined(__NetBSD__) || defined(__ANDROID__) | 362 #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || d
efined(__NetBSD__) || defined(__ANDROID__) |
| 361 #ifdef __APPLE__ | 363 #ifdef __APPLE__ |
| 362 typedef __uint32_t mask; | 364 typedef __uint32_t mask; |
| 363 #elif defined(__FreeBSD__) | 365 #elif defined(__FreeBSD__) |
| 364 typedef unsigned long mask; | 366 typedef unsigned long mask; |
| 365 #elif defined(__EMSCRIPTEN__) || defined(__NetBSD__) | 367 # elif defined(__EMSCRIPTEN__) || defined(__NetBSD__) || defined(_LIBCPP_HAS_MUS
L_LIBC) |
| 366 typedef unsigned short mask; | 368 typedef unsigned short mask; |
| 367 #elif defined(__ANDROID__) | 369 #elif defined(__ANDROID__) |
| 368 typedef unsigned char mask; | 370 typedef unsigned char mask; |
| 369 #endif | 371 #endif |
| 370 static const mask space = _CTYPE_S; | 372 static const mask space = _CTYPE_S; |
| 371 static const mask print = _CTYPE_R; | 373 static const mask print = _CTYPE_R; |
| 372 static const mask cntrl = _CTYPE_C; | 374 static const mask cntrl = _CTYPE_C; |
| 373 static const mask upper = _CTYPE_U; | 375 static const mask upper = _CTYPE_U; |
| 374 static const mask lower = _CTYPE_L; | 376 static const mask lower = _CTYPE_L; |
| 375 static const mask alpha = _CTYPE_A; | 377 static const mask alpha = _CTYPE_A; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 static const mask cntrl = _C; | 409 static const mask cntrl = _C; |
| 408 static const mask upper = _U; | 410 static const mask upper = _U; |
| 409 static const mask lower = _L; | 411 static const mask lower = _L; |
| 410 static const mask alpha = _U | _L; | 412 static const mask alpha = _U | _L; |
| 411 static const mask digit = _N; | 413 static const mask digit = _N; |
| 412 static const mask punct = _P; | 414 static const mask punct = _P; |
| 413 static const mask xdigit = _X | _N; | 415 static const mask xdigit = _X | _N; |
| 414 static const mask blank = _B; | 416 static const mask blank = _B; |
| 415 // @LOCALMOD-END | 417 // @LOCALMOD-END |
| 416 #else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || __EMSCRIPTEN__ || _
_sun__ | 418 #else // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || __EMSCRIPTEN__ || _
_sun__ |
| 419 #if defined(_LIBCPP_HAS_MUSL_LIBC) |
| 420 typedef unsigned short mask; |
| 421 #else |
| 417 typedef unsigned long mask; | 422 typedef unsigned long mask; |
| 423 #endif |
| 418 static const mask space = 1<<0; | 424 static const mask space = 1<<0; |
| 419 static const mask print = 1<<1; | 425 static const mask print = 1<<1; |
| 420 static const mask cntrl = 1<<2; | 426 static const mask cntrl = 1<<2; |
| 421 static const mask upper = 1<<3; | 427 static const mask upper = 1<<3; |
| 422 static const mask lower = 1<<4; | 428 static const mask lower = 1<<4; |
| 423 static const mask alpha = 1<<5; | 429 static const mask alpha = 1<<5; |
| 424 static const mask digit = 1<<6; | 430 static const mask digit = 1<<6; |
| 425 static const mask punct = 1<<7; | 431 static const mask punct = 1<<7; |
| 426 static const mask xdigit = 1<<8; | 432 static const mask xdigit = 1<<8; |
| 427 static const mask blank = 1<<9; | 433 static const mask blank = 1<<9; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 | 635 |
| 630 static locale::id id; | 636 static locale::id id; |
| 631 | 637 |
| 632 #ifdef _CACHED_RUNES | 638 #ifdef _CACHED_RUNES |
| 633 static const size_t table_size = _CACHED_RUNES; | 639 static const size_t table_size = _CACHED_RUNES; |
| 634 #else | 640 #else |
| 635 static const size_t table_size = 256; // FIXME: Don't hardcode this. | 641 static const size_t table_size = 256; // FIXME: Don't hardcode this. |
| 636 #endif | 642 #endif |
| 637 _LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;} | 643 _LIBCPP_ALWAYS_INLINE const mask* table() const _NOEXCEPT {return __tab_;} |
| 638 static const mask* classic_table() _NOEXCEPT; | 644 static const mask* classic_table() _NOEXCEPT; |
| 639 #if defined(__GLIBC__) || defined(__EMSCRIPTEN__) | 645 #if defined(__GLIBC__) || defined(__EMSCRIPTEN__) || defined(_LIBCPP_HAS_MUSL_LI
BC) |
| 640 static const int* __classic_upper_table() _NOEXCEPT; | 646 static const int* __classic_upper_table() _NOEXCEPT; |
| 641 static const int* __classic_lower_table() _NOEXCEPT; | 647 static const int* __classic_lower_table() _NOEXCEPT; |
| 642 #endif | 648 #endif |
| 643 #if defined(__NetBSD__) | 649 #if defined(__NetBSD__) |
| 644 static const short* __classic_upper_table() _NOEXCEPT; | 650 static const short* __classic_upper_table() _NOEXCEPT; |
| 645 static const short* __classic_lower_table() _NOEXCEPT; | 651 static const short* __classic_lower_table() _NOEXCEPT; |
| 646 #endif | 652 #endif |
| 647 | 653 |
| 648 protected: | 654 protected: |
| 649 ~ctype(); | 655 ~ctype(); |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 protected: | 1480 protected: |
| 1475 ~numpunct_byname(); | 1481 ~numpunct_byname(); |
| 1476 | 1482 |
| 1477 private: | 1483 private: |
| 1478 void __init(const char*); | 1484 void __init(const char*); |
| 1479 }; | 1485 }; |
| 1480 | 1486 |
| 1481 _LIBCPP_END_NAMESPACE_STD | 1487 _LIBCPP_END_NAMESPACE_STD |
| 1482 | 1488 |
| 1483 #endif // _LIBCPP___LOCALE | 1489 #endif // _LIBCPP___LOCALE |
| OLD | NEW |