diff options
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/ctype/jp2uc.c | 10 | ||||
-rw-r--r-- | newlib/libc/ctype/local.h | 7 | ||||
-rw-r--r-- | newlib/libc/string/local.h | 4 |
3 files changed, 12 insertions, 9 deletions
diff --git a/newlib/libc/ctype/jp2uc.c b/newlib/libc/ctype/jp2uc.c index 77443b8ff..0b0085f15 100644 --- a/newlib/libc/ctype/jp2uc.c +++ b/newlib/libc/ctype/jp2uc.c @@ -32,6 +32,9 @@ #include <newlib.h> #ifdef _MB_CAPABLE +/* Under Cygwin, the incoming wide character is already given in UTF due + to the requirements of the underlying OS. */ +#ifndef __CYGWIN__ #include <_ansi.h> #include <wctype.h> @@ -43,7 +46,7 @@ #define JP_SJIS 2 #define JP_EUCJP 3 -wint_t +static wint_t _DEFUN (__jp2uc, (c, type), wint_t c _AND int type) { int index, adj; @@ -150,17 +153,14 @@ _DEFUN (__jp2uc, (c, type), wint_t c _AND int type) wint_t _DEFUN (_jp2uc, (c), wint_t c) { -/* Under Cygwin, the incoming wide character is already given in UTF due - to the requirements of the underlying OS. */ -#ifndef __CYGWIN__ if (!strcmp (__locale_charset (), "JIS")) c = __jp2uc (c, JP_JIS); else if (!strcmp (__locale_charset (), "SJIS")) c = __jp2uc (c, JP_SJIS); else if (!strcmp (__locale_charset (), "EUCJP")) c = __jp2uc (c, JP_EUCJP); -#endif return c; } +#endif /* !__CYGWIN__ */ #endif /* _MB_CAPABLE */ diff --git a/newlib/libc/ctype/local.h b/newlib/libc/ctype/local.h index ab1c7db71..7dac35403 100644 --- a/newlib/libc/ctype/local.h +++ b/newlib/libc/ctype/local.h @@ -23,5 +23,10 @@ extern char *__locale_charset (); /* internal function to translate JP to Unicode */ +#ifdef __CYGWIN__ +/* Under Cygwin, the incoming wide character is already given in UTF due + to the requirements of the underlying OS. */ +#define _jp2uc(c) (c) +#else wint_t _EXFUN (_jp2uc, (wint_t)); - +#endif diff --git a/newlib/libc/string/local.h b/newlib/libc/string/local.h index 5b3699d9d..3fdbfa3f3 100644 --- a/newlib/libc/string/local.h +++ b/newlib/libc/string/local.h @@ -1,7 +1,5 @@ #include <_ansi.h> - -/* internal function to translate JP to Unicode */ -wint_t _EXFUN (_jp2uc, (wint_t)); +#include <../ctype/local.h> /* internal function to compute width of wide char. */ int _EXFUN (__wcwidth, (wint_t)); |