This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: [PATCH/RFA] Fix ctype table and isblank
- From: "Howland Craig D (Craig)" <howland at LGSInnovations dot com>
- To: <newlib at sourceware dot org>
- Date: Tue, 24 Mar 2009 19:21:30 -0400
- Subject: RE: [PATCH/RFA] Fix ctype table and isblank
- References: <20090324105020.GE9322@calimero.vinschen.de>
Index: libc/include/ctype.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/ctype.h,v
retrieving revision 1.13
diff -u -p -r1.13 ctype.h
--- libc/include/ctype.h 15 Oct 2008 20:49:56 -0000 1.13
+++ libc/include/ctype.h 24 Mar 2009 10:49:14 -0000
@@ -54,6 +54,10 @@ extern __IMPORT _CONST char *__ctype_ptr
#define isgraph(c)
((__ctype_ptr__)[(unsigned)((c)+1)]&(_P|_U|_L|_N))
#define iscntrl(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_C)
+#if !defined(__STRICT_ANSI__) || defined(__cplusplus) ||
__STDC_VERSION__ >= 199901L
+#define isblank(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_B)
+#endif
+
/* Non-gcc versions will get the library versions, and will be
slightly slower */
-------------------------------------------------------------------
Looking at this in the larger context, the "|| defined(__cplusplus)"
is useless, as where it is positioned in the file puts it inside of
#ifndef __cplusplus [line 44]
#endif /* !__cplusplus */ [line 66]
The macros are not supposed to be defined for C++, so it ends up
working. But the extraneous bit should be deleted as it is misleading.
Craig