[PATCH/RFA] Fix ctype table and isblank

Howland Craig D (Craig) howland@LGSInnovations.com
Tue Mar 24 23:47:00 GMT 2009


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



More information about the Newlib mailing list