Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2023-08-15 23:30:59 +0300
committerCorinna Vinschen <corinna@vinschen.de>2023-08-15 23:30:59 +0300
commitb5111e46424b693e04bc0e964a01f871a71c26ef (patch)
treeb9d462e1f582fd23616bdac7174ac2dfa979c0a6 /newlib
parent1a646ad7970a2cd3a1c931af4217cc17fc576116 (diff)
struct _reent: add state for unicode functions
C23 requires that the unicode functions c16rtomb, c8rtomb, mbrtoc16, mbrtoc32 and mbrtoc8 use their own internal state object. c32rtomb only needs an internal state if the lib supports encoding with shift states, but that's the case for newlib and Cygwin. Only Cygwin implements these functions so add the states objects only for Cygwin for now. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib')
-rw-r--r--newlib/libc/include/sys/reent.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index c71f75dbc..a6c923f1c 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -622,6 +622,14 @@ struct _reent
_mbstate_t _wcrtomb_state;
_mbstate_t _wcsrtombs_state;
int _h_errno;
+#ifdef __CYGWIN__
+ _mbstate_t _c8rtomb_state;
+ _mbstate_t _c16rtomb_state;
+ _mbstate_t _c32rtomb_state;
+ _mbstate_t _mbrtoc8_state;
+ _mbstate_t _mbrtoc16_state;
+ _mbstate_t _mbrtoc32_state;
+#endif
} _reent;
#ifdef _REENT_BACKWARD_BINARY_COMPAT
struct
@@ -730,6 +738,14 @@ struct _reent
#define _REENT_MBSRTOWCS_STATE(ptr)((ptr)->_new._reent._mbsrtowcs_state)
#define _REENT_WCRTOMB_STATE(ptr)((ptr)->_new._reent._wcrtomb_state)
#define _REENT_WCSRTOMBS_STATE(ptr)((ptr)->_new._reent._wcsrtombs_state)
+#ifdef __CYGWIN__
+# define _REENT_C8RTOMB_STATE(ptr)((ptr)->_new._reent._c8rtomb_state)
+# define _REENT_C16RTOMB_STATE(ptr)((ptr)->_new._reent._c16rtomb_state)
+# define _REENT_C32RTOMB_STATE(ptr)((ptr)->_new._reent._c32rtomb_state)
+# define _REENT_MBRTOC8_STATE(ptr)((ptr)->_new._reent._mbrtoc8_state)
+# define _REENT_MBRTOC16_STATE(ptr)((ptr)->_new._reent._mbrtoc16_state)
+# define _REENT_MBRTOC32_STATE(ptr)((ptr)->_new._reent._mbrtoc32_state)
+#endif
#define _REENT_L64A_BUF(ptr) ((ptr)->_new._reent._l64a_buf)
#define _REENT_SIGNAL_BUF(ptr) ((ptr)->_new._reent._signal_buf)
#define _REENT_GETDATE_ERR_P(ptr) (&((ptr)->_new._reent._getdate_err))