diff --git a/include/fast_float/fast_float_strtod.h b/include/fast_float/fast_float_strtod.h index bba5c81..066a501 100644 --- a/include/fast_float/fast_float_strtod.h +++ b/include/fast_float/fast_float_strtod.h @@ -1,5 +1,5 @@ -#ifndef __FAST_FLOAT_STRTOD_H__ -#define __FAST_FLOAT_STRTOD_H__ +#ifndef FAST_FLOAT_STRTOD_H__ +#define FAST_FLOAT_STRTOD_H__ #if defined(__cplusplus) extern "C" { @@ -28,4 +28,4 @@ double fast_float_strtod(const char *in, char **out); } #endif -#endif /* __FAST_FLOAT_STRTOD_H__ */ \ No newline at end of file +#endif /* FAST_FLOAT_STRTOD_H__ */ \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0d1360b..5b49118 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,7 @@ add_library(fast_float_strtod STATIC fast_float_strtod.cpp) target_link_libraries(fast_float_strtod PRIVATE fast_float) -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" AND NOT WIN32) target_link_options(fast_float_strtod PRIVATE -nostdlib++) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1c86c5d..eea2b2d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -110,7 +110,7 @@ add_subdirectory(build_tests) add_subdirectory(bloat_analysis) add_executable(strtod_test strtod_test.c) -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" AND NOT WIN32) target_link_options(strtod_test PUBLIC -nostdlib++) endif() target_link_libraries(strtod_test PUBLIC fast_float_strtod) diff --git a/tests/strtod_test.c b/tests/strtod_test.c index bcb0004..e552c69 100644 --- a/tests/strtod_test.c +++ b/tests/strtod_test.c @@ -4,25 +4,25 @@ #include int main() { - // Test successful conversion - const char *str1 = "3.14159"; - char *end1; - errno = 0; - double d1 = fast_float_strtod(str1, &end1); - printf("Input: %s\n", str1); - printf("Converted: %f\n", d1); - printf("End pointer: %s\n", end1); - printf("errno: %d\n", errno); + // Test successful conversion + const char *str1 = "3.14159"; + char *end1; + errno = 0; + double d1 = fast_float_strtod(str1, &end1); + printf("Input: %s\n", str1); + printf("Converted: %f\n", d1); + printf("End pointer: %s\n", end1); + printf("errno: %d\n", errno); - // Test invalid input - const char *str2 = "invalid"; - char *end2; - errno = 0; - double d2 = fast_float_strtod(str2, &end2); - printf("\nInput: %s\n", str2); - printf("Converted: %f\n", d2); - printf("End pointer: %s\n", end2); - printf("errno: %d\n", errno); + // Test invalid input + const char *str2 = "invalid"; + char *end2; + errno = 0; + double d2 = fast_float_strtod(str2, &end2); + printf("\nInput: %s\n", str2); + printf("Converted: %f\n", d2); + printf("End pointer: %s\n", end2); + printf("errno: %d\n", errno); - return 0; + return 0; } \ No newline at end of file