vector: gate localeconv_l and fall back to localeconv

Fixes https://github.com/harfbuzz/harfbuzz/issues/5791
This commit is contained in:
Behdad Esfahbod committed 2026-03-06 19:07:29 -07:00
1 parent 31af2b94a0
commit ef8f53fd64
2 files changed
+5 -2

No files matched your search

+1
View File
@@ -101,6 +101,7 @@ check_funcs = [
['isatty', {'prefix': '#include <unistd.h>'}],
['uselocale', {'prefix': '#include <locale.h>'}],
['newlocale', {'prefix': '#include <locale.h>'}],
['localeconv_l', {'prefix': '#include <locale.h>'}],
['sincos', {'prefix': '#define _GNU_SOURCE\n#include <math.h>'}],
['sincosf', {'prefix': '#define _GNU_SOURCE\n#include <math.h>'}],
]
+4 -2
View File
@@ -53,17 +53,19 @@ static struct hb_svg_decimal_point_lazy_loader_t
p->value[1] = '\0';
#ifndef HB_NO_SETLOCALE
#if defined(HAVE_XLOCALE_H)
lconv *lc = nullptr;
#ifdef HAVE_LOCALECONV_L
hb_locale_t current_locale = hb_uselocale ((hb_locale_t) 0);
if (current_locale)
lc = localeconv_l (current_locale);
#endif
if (!lc)
lc = localeconv ();
if (lc && lc->decimal_point && lc->decimal_point[0])
{
strncpy (p->value, lc->decimal_point, sizeof (p->value) - 1);
p->value[sizeof (p->value) - 1] = '\0';
}
#endif
#endif
hb_atexit (free_static_svg_decimal_point);