Skip to content

Commit

Permalink
fix cstr_len build issue on C++20
Browse files Browse the repository at this point in the history
  • Loading branch information
trcrsired committed Apr 28, 2024
1 parent dff48a3 commit 3b4f396
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/fast_io_core_impl/freestanding/cstr_len.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ inline constexpr ::std::size_t dummy_cstr_nlen(char_type const *cstr, ::std::siz
template <::std::integral char_type>
inline constexpr ::std::size_t cstr_len(char_type const *cstr) noexcept
{
#if __cpp_consteval >= 202106L
#ifdef __cpp_if_consteval
if consteval
{
return details::dummy_cstr_len(cstr);
}
#else
if (::std::is_constant_evaluated())
if (__builtin_is_constant_evaluated())
{
return details::dummy_cstr_len(cstr);
}
Expand Down Expand Up @@ -66,13 +66,13 @@ inline constexpr ::std::size_t cstr_len(char_type const *cstr) noexcept
template <::std::integral char_type>
inline constexpr ::std::size_t cstr_nlen(char_type const *cstr, ::std::size_t n) noexcept
{
#if __cpp_consteval >= 202106L
#ifdef __cpp_if_consteval
if consteval
{
return details::dummy_cstr_nlen(cstr, n);
}
#else
if (::std::is_constant_evaluated())
if (__builtin_is_constant_evaluated())
{
return details::dummy_cstr_nlen(cstr, n);
}
Expand Down

0 comments on commit 3b4f396

Please sign in to comment.