Skip to content

Commit

Permalink
Merge pull request #375 from ckormanyos/improve_cpp_feature_checks
Browse files Browse the repository at this point in the history
Improve some C++ feature checking
  • Loading branch information
ckormanyos authored Aug 15, 2023
2 parents f32ee23 + 4350450 commit b12100b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions math/wide_integer/uintwide_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@
#endif
#endif

#if ((__cplusplus < 202100L) || (defined(__GNUC__) && defined(__AVR__)))
#include <ciso646>
#else
#include <version>
#endif

#include <algorithm>
#include <array>
#if defined(__cpp_lib_to_chars)
#if (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))
#include <charconv>
#endif
#include <cinttypes>
Expand All @@ -40,6 +46,9 @@
#if !defined(WIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY)
#include <memory>
#endif
#if (defined(__cpp_lib_gcd_lcm) && (__cpp_lib_gcd_lcm >= 201606L))
#include <numeric>
#endif
#if !defined(WIDE_INTEGER_DISABLE_IOSTREAM)
#include <ostream>
#include <sstream>
Expand Down Expand Up @@ -1099,7 +1108,7 @@
DistributionType& distribution,
GeneratorType& generator) -> bool;

#if defined(__cpp_lib_to_chars)
#if (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))
template<const size_t Width2,
typename LimbType,
typename AllocatorType,
Expand Down Expand Up @@ -5979,7 +5988,11 @@
template<typename UnsignedShortType>
WIDE_INTEGER_CONSTEXPR auto integer_gcd_reduce(UnsignedShortType u, UnsignedShortType v) -> UnsignedShortType
{
#if (defined(__cpp_lib_gcd_lcm) && (__cpp_lib_gcd_lcm >= 201606L))
return std::gcd(u, v);
#else
return detail::gcd_unsafe(u, v);
#endif
}

} // namespace detail
Expand Down Expand Up @@ -6706,7 +6719,7 @@
return is_probably_prime;
}

#if defined(__cpp_lib_to_chars)
#if (defined(__cpp_lib_to_chars) && (__cpp_lib_to_chars >= 201611L))
template<const size_t Width2,
typename LimbType,
typename AllocatorType,
Expand Down

0 comments on commit b12100b

Please sign in to comment.