From 0a1bf115605345d99755bfa497e203f2cf859957 Mon Sep 17 00:00:00 2001 From: Anders Dalvander Date: Sun, 1 Dec 2024 16:36:45 +0100 Subject: [PATCH] harmonize ifdef checks --- include/fast_float/float_common.h | 4 ++-- include/fast_float/parse_number.h | 4 ++-- tests/fixedwidthtest.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index 5e044b6..a5ece5c 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -221,10 +221,10 @@ template struct is_supported_float_type : std::integral_constant::value || std::is_same::value -#if __STDCPP_FLOAT32_T__ +#ifdef __STDCPP_FLOAT32_T__ || std::is_same::value #endif -#if __STDCPP_FLOAT64_T__ +#ifdef __STDCPP_FLOAT64_T__ || std::is_same::value #endif > { diff --git a/include/fast_float/parse_number.h b/include/fast_float/parse_number.h index d8aac91..fb946d1 100644 --- a/include/fast_float/parse_number.h +++ b/include/fast_float/parse_number.h @@ -145,7 +145,7 @@ template struct from_chars_caller { } }; -#if __STDCPP_FLOAT32_T__ == 1 +#ifdef __STDCPP_FLOAT32_T__ template <> struct from_chars_caller { template FASTFLOAT_CONSTEXPR20 static from_chars_result_t @@ -162,7 +162,7 @@ template <> struct from_chars_caller { }; #endif -#if __STDCPP_FLOAT64_T__ == 1 +#ifdef __STDCPP_FLOAT64_T__ template <> struct from_chars_caller { template FASTFLOAT_CONSTEXPR20 static from_chars_result_t diff --git a/tests/fixedwidthtest.cpp b/tests/fixedwidthtest.cpp index 12eb2b1..35c5231 100644 --- a/tests/fixedwidthtest.cpp +++ b/tests/fixedwidthtest.cpp @@ -12,7 +12,7 @@ int main() { // Write some testcases for the parsing of floating point numbers in the // float32_t type. We use the from_chars function defined in this library. -#if __STDCPP_FLOAT32_T__ +#ifdef __STDCPP_FLOAT32_T__ std::vector const float32_test_expected{ 123.456f, -78.9f, 0.0001f, 3.40282e+038f}; std::vector const float32_test{"123.456", "-78.9", "0.0001", @@ -37,7 +37,7 @@ int main() { std::cout << "No std::float32_t type available." << std::endl; #endif -#if __STDCPP_FLOAT64_T__ +#ifdef __STDCPP_FLOAT64_T__ // Test cases for std::float64_t std::vector const float64_test_expected{ 1.23e4, -5.67e-8, 1.7976931348623157e+308, -1.7976931348623157e+308};