mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
mesa/main: rework locale setup/teardown
Cc: mesa-stable
Signed-off-by: Thong Thai <thong.thai@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 7373f25c09)
This commit is contained in:
parent
f24980f741
commit
9ecc019d4d
3 changed files with 12 additions and 5 deletions
|
|
@ -958,7 +958,7 @@
|
|||
"description": "mesa/main: rework locale setup/teardown",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -184,7 +184,6 @@ static void
|
|||
one_time_fini(void)
|
||||
{
|
||||
glsl_type_singleton_decref();
|
||||
_mesa_locale_fini();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -35,14 +35,22 @@ static locale_t loc;
|
|||
#endif
|
||||
|
||||
#include "strtod.h"
|
||||
#include "util/u_call_once.h"
|
||||
|
||||
static void
|
||||
_mesa_locale_init_once(void)
|
||||
{
|
||||
#if defined(_GNU_SOURCE) && defined(HAVE_STRTOD_L)
|
||||
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
|
||||
atexit(_mesa_locale_fini);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_locale_init(void)
|
||||
{
|
||||
#if defined(_GNU_SOURCE) && defined(HAVE_STRTOD_L)
|
||||
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
|
||||
#endif
|
||||
static util_once_flag once = UTIL_ONCE_FLAG_INIT;
|
||||
util_call_once(&once, _mesa_locale_init_once);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue