mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-25 17:01:17 +01:00
vector: gate localeconv_l and fall back to localeconv
Fixes https://github.com/harfbuzz/harfbuzz/issues/5791
This commit is contained in:
1 parent
31af2b94a0
commit
ef8f53fd64
2 files changed
+5
-2
No files matched your search
@@ -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>'}],
|
||||
]
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user