aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r--newlib/libc/stdlib/mblen.c4
-rw-r--r--newlib/libc/stdlib/mbtowc.c4
-rw-r--r--newlib/libc/stdlib/wctomb.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/newlib/libc/stdlib/mblen.c b/newlib/libc/stdlib/mblen.c
index d9b774e..c85a6a7 100644
--- a/newlib/libc/stdlib/mblen.c
+++ b/newlib/libc/stdlib/mblen.c
@@ -51,9 +51,9 @@ _DEFUN (mblen, (s, n),
size_t n)
{
#ifdef MB_CAPABLE
- static int state;
+ _REENT_CHECK_MISC(_REENT);
- return _mbtowc_r (_REENT, NULL, s, n, &state);
+ return _mbtowc_r (_REENT, NULL, s, n, &(_REENT_MBLEN_STATE(_REENT)));
#else /* not MB_CAPABLE */
if (s == NULL || *s == '\0')
return 0;
diff --git a/newlib/libc/stdlib/mbtowc.c b/newlib/libc/stdlib/mbtowc.c
index 5e34fe3..0d16f0d 100644
--- a/newlib/libc/stdlib/mbtowc.c
+++ b/newlib/libc/stdlib/mbtowc.c
@@ -60,9 +60,9 @@ _DEFUN (mbtowc, (pwc, s, n),
size_t n)
{
#ifdef MB_CAPABLE
- static int state;
+ _REENT_CHECK_MISC(_REENT);
- return _mbtowc_r (_REENT, pwc, s, n, &state);
+ return _mbtowc_r (_REENT, pwc, s, n, &(_REENT_MBTOWC_STATE(_REENT)));
#else /* not MB_CAPABLE */
if (s == NULL)
return 0;
diff --git a/newlib/libc/stdlib/wctomb.c b/newlib/libc/stdlib/wctomb.c
index a681250..5cff10f 100644
--- a/newlib/libc/stdlib/wctomb.c
+++ b/newlib/libc/stdlib/wctomb.c
@@ -54,9 +54,9 @@ _DEFUN (wctomb, (s, wchar),
wchar_t wchar)
{
#ifdef MB_CAPABLE
- static int state;
+ _REENT_CHECK_MISC(_REENT);
- return _wctomb_r (_REENT, s, wchar, &state);
+ return _wctomb_r (_REENT, s, wchar, &(_REENT_WCTOMB_STATE(_REENT)));
#else /* not MB_CAPABLE */
if (s == NULL)
return 0;