aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/locale/uselocale.c
diff options
context:
space:
mode:
authorMatt Joyce <matthew.joyce@embedded-brains.de>2022-02-02 12:47:30 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-07-13 06:55:46 +0200
commit50f078b48cea6664975b87cbacf2a7dfacb42fba (patch)
tree723555825e0e3be481368942a502db6a9eca2e2b /newlib/libc/locale/uselocale.c
parent0985d418cb2d0a5ba56518e9e1fb9a31f3c7ba48 (diff)
downloadnewlib-50f078b48cea6664975b87cbacf2a7dfacb42fba.zip
newlib-50f078b48cea6664975b87cbacf2a7dfacb42fba.tar.gz
newlib-50f078b48cea6664975b87cbacf2a7dfacb42fba.tar.bz2
Add _REENT_LOCALE(ptr)
Add a _REENT_LOCALE() macro to encapsulate access to the _locale member of struct reent. This will help to replace the struct member with a thread-local storage object in a follow up patch.
Diffstat (limited to 'newlib/libc/locale/uselocale.c')
-rw-r--r--newlib/libc/locale/uselocale.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/newlib/libc/locale/uselocale.c b/newlib/libc/locale/uselocale.c
index 83ebcdd..799fb72 100644
--- a/newlib/libc/locale/uselocale.c
+++ b/newlib/libc/locale/uselocale.c
@@ -64,9 +64,9 @@ _uselocale_r (struct _reent *p, struct __locale_t *newloc)
if (!current_locale)
current_locale = LC_GLOBAL_LOCALE;
if (newloc == LC_GLOBAL_LOCALE)
- p->_locale = NULL;
+ _REENT_LOCALE(p) = NULL;
else if (newloc)
- p->_locale = newloc;
+ _REENT_LOCALE(p) = newloc;
return current_locale;
}