mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
i18n: Simplify `RUN_IN_LOCALE_SECTION' (GNU version).
* libguile/i18n.c (RUN_IN_LOCALE_SECTION)[USE_GNU_LOCALE_API]: Remove extraneous uselocale(3) call.
This commit is contained in:
parent
d7a2207326
commit
12f0c3e547
1 changed files with 9 additions and 13 deletions
|
@ -509,19 +509,15 @@ get_current_locale (SCM *result)
|
|||
#else /* USE_GNU_LOCALE_API */
|
||||
|
||||
/* Convenient macro to run STATEMENT in the locale context of C_LOCALE. */
|
||||
#define RUN_IN_LOCALE_SECTION(_c_locale, _statement) \
|
||||
do \
|
||||
{ \
|
||||
scm_t_locale old_loc = uselocale (NULL); \
|
||||
if (old_loc != _c_locale) \
|
||||
{ \
|
||||
uselocale (_c_locale); \
|
||||
_statement ; \
|
||||
uselocale (old_loc); \
|
||||
} \
|
||||
else \
|
||||
_statement; \
|
||||
} \
|
||||
#define RUN_IN_LOCALE_SECTION(_c_locale, _statement) \
|
||||
do \
|
||||
{ \
|
||||
scm_t_locale old_loc; \
|
||||
\
|
||||
old_loc = uselocale (_c_locale); \
|
||||
_statement ; \
|
||||
uselocale (old_loc); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue