diff options
| author | Eric Fiselier <eric@efcs.ca> | 2017-10-17 13:16:01 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2017-10-17 13:16:01 +0000 |
| commit | da0183947f9f4ca5a642a4abf2bfeb2a99e7430f (patch) | |
| tree | c4752bcf5415ea031f9dd94ad493c8702184b4bb /libcxx/include/string | |
| parent | 1c0cedccb62480d61bc4c0c31c871f9096b4873a (diff) | |
| download | bcm5719-llvm-da0183947f9f4ca5a642a4abf2bfeb2a99e7430f.tar.gz bcm5719-llvm-da0183947f9f4ca5a642a4abf2bfeb2a99e7430f.zip | |
Refactor _LIBCPP_<LITTLE|BIG>_ENDIAN
Previously this macro used 0/1 to indicate if it was set.
This is unlike all other libc++ configuration macros which
use ifdef/ifndef.
This patch makes this macro consistent with everything else.
llvm-svn: 315995
Diffstat (limited to 'libcxx/include/string')
| -rw-r--r-- | libcxx/include/string | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libcxx/include/string b/libcxx/include/string index 7775587a42d..acd287652f2 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -670,7 +670,7 @@ private: size_type __cap_; }; -#if _LIBCPP_BIG_ENDIAN +#ifdef _LIBCPP_BIG_ENDIAN static const size_type __short_mask = 0x01; static const size_type __long_mask = 0x1ul; #else // _LIBCPP_BIG_ENDIAN @@ -700,7 +700,7 @@ private: pointer __data_; }; -#if _LIBCPP_BIG_ENDIAN +#ifdef _LIBCPP_BIG_ENDIAN static const size_type __short_mask = 0x80; static const size_type __long_mask = ~(size_type(~0) >> 1); #else // _LIBCPP_BIG_ENDIAN @@ -1241,7 +1241,7 @@ private: _LIBCPP_INLINE_VISIBILITY void __set_short_size(size_type __s) _NOEXCEPT -# if _LIBCPP_BIG_ENDIAN +# ifdef _LIBCPP_BIG_ENDIAN {__r_.first().__s.__size_ = (unsigned char)(__s << 1);} # else {__r_.first().__s.__size_ = (unsigned char)(__s);} @@ -1249,7 +1249,7 @@ private: _LIBCPP_INLINE_VISIBILITY size_type __get_short_size() const _NOEXCEPT -# if _LIBCPP_BIG_ENDIAN +# ifdef _LIBCPP_BIG_ENDIAN {return __r_.first().__s.__size_ >> 1;} # else {return __r_.first().__s.__size_;} @@ -1259,7 +1259,7 @@ private: _LIBCPP_INLINE_VISIBILITY void __set_short_size(size_type __s) _NOEXCEPT -# if _LIBCPP_BIG_ENDIAN +# ifdef _LIBCPP_BIG_ENDIAN {__r_.first().__s.__size_ = (unsigned char)(__s);} # else {__r_.first().__s.__size_ = (unsigned char)(__s << 1);} @@ -1267,7 +1267,7 @@ private: _LIBCPP_INLINE_VISIBILITY size_type __get_short_size() const _NOEXCEPT -# if _LIBCPP_BIG_ENDIAN +# ifdef _LIBCPP_BIG_ENDIAN {return __r_.first().__s.__size_;} # else {return __r_.first().__s.__size_ >> 1;} @@ -2870,7 +2870,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type basic_string<_CharT, _Traits, _Allocator>::max_size() const _NOEXCEPT { size_type __m = __alloc_traits::max_size(__alloc()); -#if _LIBCPP_BIG_ENDIAN +#ifdef _LIBCPP_BIG_ENDIAN return (__m <= ~__long_mask ? __m : __m/2) - __alignment; #else return __m - __alignment; |

