This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH/RFA] Fix ctype table and isblank


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]