Skip to content

Commit 0a1bf11

Browse files
committed
harmonize ifdef checks
1 parent 3146e68 commit 0a1bf11

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/fast_float/float_common.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ template <typename T>
221221
struct is_supported_float_type
222222
: std::integral_constant<bool, std::is_same<T, float>::value ||
223223
std::is_same<T, double>::value
224-
#if __STDCPP_FLOAT32_T__
224+
#ifdef __STDCPP_FLOAT32_T__
225225
|| std::is_same<T, std::float32_t>::value
226226
#endif
227-
#if __STDCPP_FLOAT64_T__
227+
#ifdef __STDCPP_FLOAT64_T__
228228
|| std::is_same<T, std::float64_t>::value
229229
#endif
230230
> {

include/fast_float/parse_number.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ template <typename T> struct from_chars_caller {
145145
}
146146
};
147147

148-
#if __STDCPP_FLOAT32_T__ == 1
148+
#ifdef __STDCPP_FLOAT32_T__
149149
template <> struct from_chars_caller<std::float32_t> {
150150
template <typename UC>
151151
FASTFLOAT_CONSTEXPR20 static from_chars_result_t<UC>
@@ -162,7 +162,7 @@ template <> struct from_chars_caller<std::float32_t> {
162162
};
163163
#endif
164164

165-
#if __STDCPP_FLOAT64_T__ == 1
165+
#ifdef __STDCPP_FLOAT64_T__
166166
template <> struct from_chars_caller<std::float64_t> {
167167
template <typename UC>
168168
FASTFLOAT_CONSTEXPR20 static from_chars_result_t<UC>

tests/fixedwidthtest.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
int main() {
1313
// Write some testcases for the parsing of floating point numbers in the
1414
// float32_t type. We use the from_chars function defined in this library.
15-
#if __STDCPP_FLOAT32_T__
15+
#ifdef __STDCPP_FLOAT32_T__
1616
std::vector<std::float32_t> const float32_test_expected{
1717
123.456f, -78.9f, 0.0001f, 3.40282e+038f};
1818
std::vector<std::string_view> const float32_test{"123.456", "-78.9", "0.0001",
@@ -37,7 +37,7 @@ int main() {
3737
std::cout << "No std::float32_t type available." << std::endl;
3838
#endif
3939

40-
#if __STDCPP_FLOAT64_T__
40+
#ifdef __STDCPP_FLOAT64_T__
4141
// Test cases for std::float64_t
4242
std::vector<std::float64_t> const float64_test_expected{
4343
1.23e4, -5.67e-8, 1.7976931348623157e+308, -1.7976931348623157e+308};

0 commit comments

Comments
 (0)