aboutsummaryrefslogtreecommitdiffstats
path: root/include/bit
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-23 17:52:30 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-23 17:52:30 +0000
commit243a6be085fe6a7ce49169864c68a8839735e49b (patch)
treeabfecf3c23dc7512ca48e72ac418b149c865e0f3 /include/bit
parent1147845301c03308e3419b89c28c77bb6917fe04 (diff)
downloadsrc-vendor/libc++.tar.gz
src-vendor/libc++.zip
Vendor import of stripped libc++ trunk r375505, the last commit beforevendor/libc++/libc++-trunk-r375505vendor/libc++
the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/libcxx/trunk@375505
Notes
Notes: svn path=/vendor/libc++/dist/; revision=353946 svn path=/vendor/libc++/libc++-r375505/; revision=353947; tag=vendor/libc++/libc++-trunk-r375505
Diffstat (limited to 'include/bit')
-rw-r--r--include/bit21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/bit b/include/bit
index 1c0e8ad3ba8b..8800b22b7bcb 100644
--- a/include/bit
+++ b/include/bit
@@ -42,6 +42,13 @@ namespace std {
template<class T>
constexpr int popcount(T x) noexcept; // C++20
+ // 20.15.9, endian
+ enum class endian {
+ little = see below, // C++20
+ big = see below, // C++20
+ native = see below // C++20
+};
+
} // namespace std
*/
@@ -456,6 +463,20 @@ log2p1(_Tp __t) noexcept
return __t == 0 ? 0 : __bit_log2(__t) + 1;
}
+
+enum class endian
+{
+ little = 0xDEAD,
+ big = 0xFACE,
+#if defined(_LIBCPP_LITTLE_ENDIAN)
+ native = little
+#elif defined(_LIBCPP_BIG_ENDIAN)
+ native = big
+#else
+ native = 0xCAFE
+#endif
+};
+
#endif // _LIBCPP_STD_VER > 17
_LIBCPP_END_NAMESPACE_STD