Modified cmakelist to use C++23. Fixed ifdef for fixed-width float types

This commit is contained in:
MTahaK 2023-12-12 18:16:27 -05:00
parent b0f4535781
commit eb844a1ad9
2 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ target_include_directories(
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
) )
target_compile_features(fast_float INTERFACE cxx_std_11) target_compile_features(fast_float INTERFACE cxx_std_23)
if(FASTFLOAT_SANITIZE) if(FASTFLOAT_SANITIZE)
target_compile_options(fast_float INTERFACE -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all) 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) target_link_libraries(fast_float INTERFACE -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all)

View File

@ -137,7 +137,7 @@ template<typename T, typename UC>
FASTFLOAT_CONSTEXPR20 FASTFLOAT_CONSTEXPR20
from_chars_result_t<UC> from_chars(UC const * first, UC const * last, from_chars_result_t<UC> from_chars(UC const * first, UC const * last,
T &value, chars_format fmt /*= chars_format::general*/) noexcept { 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; // 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 // set value to float due to equivalence between float and float32_t
if(std::is_same<T, std::float32_t>::value){ if(std::is_same<T, std::float32_t>::value){
@ -147,7 +147,7 @@ from_chars_result_t<UC> from_chars(UC const * first, UC const * last,
return ret; return ret;
} }
#endif #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; // 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 // set value as double due to equivalence between double and float64_t
if(std::is_same<T, std::float64_t>::value){ if(std::is_same<T, std::float64_t>::value){