mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 17:58:26 +02:00
util: check and initialize locale before using it
Cc: mesa-stable
Signed-off-by: Thong Thai <thong.thai@amd.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22699>
(cherry picked from commit 27eafdcbd5)
This commit is contained in:
parent
26e3bf39f7
commit
966bd8fb0b
2 changed files with 3 additions and 1 deletions
|
|
@ -8674,7 +8674,7 @@
|
||||||
"description": "util: check and initialize locale before using it",
|
"description": "util: check and initialize locale before using it",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 0,
|
"nomination_type": 0,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": null,
|
"because_sha": null,
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ double
|
||||||
_mesa_strtod(const char *s, char **end)
|
_mesa_strtod(const char *s, char **end)
|
||||||
{
|
{
|
||||||
#if defined(_GNU_SOURCE) && defined(HAVE_STRTOD_L)
|
#if defined(_GNU_SOURCE) && defined(HAVE_STRTOD_L)
|
||||||
|
if (!loc) _mesa_locale_init();
|
||||||
return strtod_l(s, end, loc);
|
return strtod_l(s, end, loc);
|
||||||
#else
|
#else
|
||||||
return strtod(s, end);
|
return strtod(s, end);
|
||||||
|
|
@ -84,6 +85,7 @@ float
|
||||||
_mesa_strtof(const char *s, char **end)
|
_mesa_strtof(const char *s, char **end)
|
||||||
{
|
{
|
||||||
#if defined(_GNU_SOURCE) && defined(HAVE_STRTOD_L)
|
#if defined(_GNU_SOURCE) && defined(HAVE_STRTOD_L)
|
||||||
|
if (!loc) _mesa_locale_init();
|
||||||
return strtof_l(s, end, loc);
|
return strtof_l(s, end, loc);
|
||||||
#elif defined(HAVE_STRTOF)
|
#elif defined(HAVE_STRTOF)
|
||||||
return strtof(s, end);
|
return strtof(s, end);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue