From d8482a2540d44be10273ebfcb994218b4914a351 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 3 Apr 2025 10:57:03 +1000 Subject: [PATCH] util: use a late declaration to avoid one ifdef Part-of: --- src/util-strings.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/util-strings.h b/src/util-strings.h index 558ec68d..4c9a3ae1 100644 --- a/src/util-strings.h +++ b/src/util-strings.h @@ -255,9 +255,6 @@ safe_atod(const char *str, double *val) char *endptr; double v; -#ifdef HAVE_LOCALE_H - locale_t c_locale; -#endif size_t slen = strlen(str); /* We don't have a use-case where we want to accept hex for a double @@ -279,7 +276,7 @@ safe_atod(const char *str, double *val) #ifdef HAVE_LOCALE_H /* Create a "C" locale to force strtod to use '.' as separator */ - c_locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); + locale_t c_locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); if (c_locale == (locale_t)0) return false;