Message ID | YHXMyWnHeDgIV+VJ@redhat.com |
---|---|
State | New |
Headers | show |
Series | [committed] libstdc++: Fix <bit> to work freestanding [PR 100060] | expand |
diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index fb78578448c..c5aae8bab03 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -34,7 +34,23 @@ #if __cplusplus >= 201402L #include <type_traits> -#include <ext/numeric_traits.h> + +#if _GLIBCXX_HOSTED +# include <ext/numeric_traits.h> +#else +# include <limits> +/// @cond undocumented +namespace __gnu_cxx +{ + template<typename _Tp> + struct __int_traits + { + static constexpr int __digits = std::numeric_limits<_Tp>::digits; + static constexpr _Tp __max = std::numeric_limits<_Tp>::max(); + }; +} +/// @endcond +#endif namespace std _GLIBCXX_VISIBILITY(default) {