diff options
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r-- | newlib/libc/stdlib/mbtowc_r.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdlib/wctomb_r.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/newlib/libc/stdlib/mbtowc_r.c b/newlib/libc/stdlib/mbtowc_r.c index 7c6be69ea..d84fef5a2 100644 --- a/newlib/libc/stdlib/mbtowc_r.c +++ b/newlib/libc/stdlib/mbtowc_r.c @@ -78,6 +78,7 @@ typedef enum { COPY_A, COPY_J1, COPY_J2, MAKE_A, NOOP, EMPTY, ERROR } JIS_ACTION * is 2 (switch to JIS) + 2 (JIS characters) + 2 (switch back to ASCII) = 6. *************************************************************************************/ +#ifndef __CYGWIN__ static JIS_STATE JIS_state_table[JIS_S_NUM][JIS_C_NUM] = { /* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTHER */ /* ASCII */ { A_ESC, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII }, @@ -99,6 +100,7 @@ static JIS_ACTION JIS_action_table[JIS_S_NUM][JIS_C_NUM] = { /* J_ESC */ { ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR }, /* J_ESC_BR */{ ERROR, ERROR, ERROR, ERROR, MAKE_A, MAKE_A, ERROR, ERROR, ERROR }, }; +#endif /* !__CYGWIN__ */ /* we override the mbstate_t __count field for more complex encodings and use it store a state value */ #define __state __count diff --git a/newlib/libc/stdlib/wctomb_r.c b/newlib/libc/stdlib/wctomb_r.c index 98a0b74c0..13e1e4c36 100644 --- a/newlib/libc/stdlib/wctomb_r.c +++ b/newlib/libc/stdlib/wctomb_r.c @@ -81,7 +81,7 @@ _DEFUN (__utf8_wctomb, (r, s, wchar, charset, state), to return extra 3 bytes. */ wchar_t tmp; tmp = (state->__value.__wchb[0] << 16 | state->__value.__wchb[1] << 8) - - 0x10000 >> 10 | 0xd80d; + - (0x10000 >> 10 | 0xd80d); *s++ = 0xe0 | ((tmp & 0xf000) >> 12); *s++ = 0x80 | ((tmp & 0xfc0) >> 6); *s++ = 0x80 | (tmp & 0x3f); |