This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: [PATCH] Fwd: [1.7] Remove the overhead of calling function _jp2uc
- From: "Howland Craig D (Craig)" <howland at LGSInnovations dot com>
- To: <newlib at sourceware dot org>
- Date: Fri, 15 May 2009 12:51:04 -0400
- Subject: RE: [PATCH] Fwd: [1.7] Remove the overhead of calling function _jp2uc
- References: <3f0ad08d0905150657s4033e61ex198d22e10074ad9e@mail.gmail.com> <3f0ad08d0905150835m1d77244br22b02f3ba86cd4ef@mail.gmail.com>
It would be better to not do the same thing in two places: should
string/local.h do a nested include to bring in ctype/local.h to
avoid maintenance issues?
Craig
-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
On Behalf Of IWAMURO Motonori
Sent: Friday, May 15, 2009 11:35 AM
To: newlib@sourceware.org
Subject: [PATCH] Fwd: [1.7] Remove the overhead of calling function
_jp2uc
...
> I propose to remove the overhead of calling function _jp2uc.
...
Index: newlib/libc/ctype/local.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/ctype/local.h,v
retrieving revision 1.3
diff -u -p -r1.3 local.h
--- newlib/libc/ctype/local.h 14 May 2009 20:16:21 -0000 1.3
+++ newlib/libc/ctype/local.h 15 May 2009 13:54:36 -0000
@@ -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
Index: newlib/libc/string/local.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/string/local.h,v
retrieving revision 1.1
diff -u -p -r1.1 local.h
--- newlib/libc/string/local.h 15 May 2009 11:40:28 -0000 1.1
+++ newlib/libc/string/local.h 15 May 2009 13:54:37 -0000
@@ -1,7 +1,13 @@
#include <_ansi.h>
/* 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
/* internal function to compute width of wide char. */
int _EXFUN (__wcwidth, (wint_t));
--
IWAMURO Motnori <http://vmi.jp/>