diff --git a/CMakeLists.txt b/CMakeLists.txt index 8847f06..da1f631 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ target_include_directories( $ $ ) -target_compile_features(fast_float INTERFACE cxx_std_11) +target_compile_features(fast_float INTERFACE cxx_std_23) if(FASTFLOAT_SANITIZE) target_compile_options(fast_float INTERFACE -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all) target_link_libraries(fast_float INTERFACE -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all) diff --git a/include/fast_float/parse_number.h b/include/fast_float/parse_number.h index c65099b..67f3fcc 100644 --- a/include/fast_float/parse_number.h +++ b/include/fast_float/parse_number.h @@ -137,7 +137,7 @@ template FASTFLOAT_CONSTEXPR20 from_chars_result_t from_chars(UC const * first, UC const * last, T &value, chars_format fmt /*= chars_format::general*/) noexcept { -#ifdef __STDCPP_FLOAT32_T__ +#ifdef defined(__STDCPP_FLOAT32_T__) // if std::float32_t is defined, then we are in C++23 mode; macro set for float32; // set value to float due to equivalence between float and float32_t if(std::is_same::value){ @@ -147,7 +147,7 @@ from_chars_result_t from_chars(UC const * first, UC const * last, return ret; } #endif -#ifdef __STDCPP_FLOAT64_T__ +#ifdef defined(__STDCPP_FLOAT64_T__) // if std::float64_t is defined, then we are in C++23 mode; macro set for float64; // set value as double due to equivalence between double and float64_t if(std::is_same::value){