Util: Fix #if into #ifdef

This commit is contained in:
Vicki Pfau 2024-04-08 02:53:00 -07:00
parent 02b2f5a98a
commit 4652bbb427
1 changed files with 4 additions and 4 deletions

View File

@ -46,26 +46,26 @@ float strtof_l(const char* restrict str, char** restrict end, locale_t locale) {
#endif
int ftostr_u(char* restrict str, size_t size, float f) {
#if HAVE_LOCALE
#ifdef HAVE_LOCALE
locale_t l = newlocale(LC_NUMERIC_MASK, "C", 0);
#else
locale_t l = "C";
#endif
int res = ftostr_l(str, size, f, l);
#if HAVE_LOCALE
#ifdef HAVE_LOCALE
freelocale(l);
#endif
return res;
}
float strtof_u(const char* restrict str, char** restrict end) {
#if HAVE_LOCALE
#ifdef HAVE_LOCALE
locale_t l = newlocale(LC_NUMERIC_MASK, "C", 0);
#else
locale_t l = "C";
#endif
float res = strtof_l(str, end, l);
#if HAVE_LOCALE
#ifdef HAVE_LOCALE
freelocale(l);
#endif
return res;