From 4ee5d08a46d8c3a7570e03bb128232a6d6427751 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 23 Apr 2024 15:11:29 +0800 Subject: [PATCH] core: convert strtod.c to C++ Signed-off-by: Berthold Stoeger --- Subsurface-mobile.pro | 2 +- core/CMakeLists.txt | 2 +- core/{strtod.c => strtod.cpp} | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename core/{strtod.c => strtod.cpp} (93%) diff --git a/Subsurface-mobile.pro b/Subsurface-mobile.pro index 88e1d3ae2..161688f29 100644 --- a/Subsurface-mobile.pro +++ b/Subsurface-mobile.pro @@ -93,7 +93,7 @@ SOURCES += subsurface-mobile-main.cpp \ core/selection.cpp \ core/sha1.c \ core/string-format.cpp \ - core/strtod.c \ + core/strtod.cpp \ core/tag.cpp \ core/taxonomy.c \ core/time.cpp \ diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index b4cc55723..0460a7bd0 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -169,7 +169,7 @@ set(SUBSURFACE_CORE_LIB_SRCS statistics.h string-format.h string-format.cpp - strtod.c + strtod.cpp subsurface-float.h subsurface-string.cpp subsurface-string.h diff --git a/core/strtod.c b/core/strtod.cpp similarity index 93% rename from core/strtod.c rename to core/strtod.cpp index 39abfb7a7..e76ee47c0 100644 --- a/core/strtod.c +++ b/core/strtod.cpp @@ -109,12 +109,12 @@ no_conversion: return 0.0; } -double permissive_strtod(const char *str, const char **ptr) +extern "C" double permissive_strtod(const char *str, const char **ptr) { return strtod_flags(str, ptr, false); } -double ascii_strtod(const char *str, const char **ptr) +extern "C" double ascii_strtod(const char *str, const char **ptr) { return strtod_flags(str, ptr, true); }