Skip to content

Commit 7960682

Browse files
committed
Change check for 128 bit integers
1 parent a3d1149 commit 7960682

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/boost/charconv/detail/from_chars_integer_impl.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ BOOST_CXX14_CONSTEXPR from_chars_result from_chars_integer_impl(const char* firs
186186
}
187187
}
188188

189-
#ifdef BOOST_CHARCONV_HAS_INT128
190-
BOOST_IF_CONSTEXPR (std::is_same<Integer, boost::int128_type>::value)
189+
BOOST_IF_CONSTEXPR ((std::numeric_limits<Integer>::is_signed && sizeof(Integer) == 16)
190+
#ifdef BOOST_CHARCONV_HAS_INT128
191+
|| std::is_same<boost::int128_type, Integer>::value
192+
#endif
193+
)
191194
{
192195
overflow_value /= unsigned_base;
193196
max_digit %= unsigned_base;
@@ -200,7 +203,6 @@ BOOST_CXX14_CONSTEXPR from_chars_result from_chars_integer_impl(const char* firs
200203
#endif
201204
}
202205
else
203-
#endif
204206
{
205207
overflow_value /= unsigned_base;
206208
max_digit %= unsigned_base;

0 commit comments

Comments
 (0)