From: Jonathan Wakely Date: Tue, 13 Apr 2021 15:55:37 +0000 (+0100) Subject: libstdc++: Fix to work freestanding [PR 100060] X-Git-Tag: basepoints/gcc-12~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=474cb5a0a404c5de7c1cd21aac8b1b7e7ce95d9b;p=thirdparty%2Fgcc.git libstdc++: Fix to work freestanding [PR 100060] libstdc++-v3/ChangeLog: PR libstdc++/100060 * include/std/bit: Only include for hosted build, use otherwise. --- diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index fb78578448c0..c5aae8bab03e 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -34,7 +34,23 @@ #if __cplusplus >= 201402L #include -#include + +#if _GLIBCXX_HOSTED +# include +#else +# include +/// @cond undocumented +namespace __gnu_cxx +{ + template + 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) {