Skip to content

gstrfuncs: don't require nonstandard functions for USE_XLOCALE.

Érico Rolim requested to merge ericonr/glib:xlocale-musl into main

Make it so USE_XLOCALE is set whenever newlocale() and uselocale() are available. This way, we can still use the _g_snprintf() path for some functions, and also use the *_l functions when they are available.

newlocale(3) are uselocale(3) part of POSIX 2008, while the *_l functions being used are nonstandard glibc extensions. Gating all the locale functionality behind them meant we were using fallbacks on non glibc platforms unnecessarily.

Further changes to this code could add fallback for the non _l suffixed number parsing functions, but that might be unnecessary complexity.

Fixes #2553 (closed)

Merge request reports