From e17c0a23e32e35d037e75e21389c485c4fded87d Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 2 Jun 2009 09:41:06 +0000 Subject: [PATCH] * libc/ctype/jp2uc.c: Skip all definition if defined __CYGWIN__. (__jp2uc): Change the scope to static function. * libc/ctype/local.h (_jp2uc): Define as macro if defined __CYGWIN__. * libc/string/local.h (_jp2uc): Include ../ctype/local.h. --- newlib/ChangeLog | 7 +++++++ newlib/libc/ctype/jp2uc.c | 10 +++++----- newlib/libc/ctype/local.h | 7 ++++++- newlib/libc/string/local.h | 4 +--- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 4bd5edf09..b1cf326ca 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +2009-06-02 IWAMURO Motonori + + * libc/ctype/jp2uc.c: Skip all definition if defined __CYGWIN__. + (__jp2uc): Change the scope to static function. + * libc/ctype/local.h (_jp2uc): Define as macro if defined __CYGWIN__. + * libc/string/local.h (_jp2uc): Include ../ctype/local.h. + 2009-05-27 Neal H. Walfield * libc/include/machine/setjmp.h (sigjmp_buf): Size according to 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 #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 @@ -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));