Skip to content

Commit 4d27cd6

Browse files
committed
ctype: Fixup for C++ compatibility
libstdc++ uses _ctype_ and the various ctype bitmasks, so we need to make those visible when compiling with C++. Signed-off-by: Keith Packard <[email protected]>
1 parent b382623 commit 4d27cd6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

newlib/libc/include/ctype.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,6 @@ extern const short _ctype_wide[];
225225

226226
#define _ctype_ (_ctype_b + _CTYPE_OFFSET)
227227

228-
#ifndef __cplusplus
229-
230228
#define _U 0x001 /* upper */
231229
#define _L 0x002 /* lower */
232230
#define _N 0x004 /* digit */
@@ -245,6 +243,8 @@ const char *__locale_ctype_ptr (void);
245243
#define __CTYPE_PTR _ctype_
246244
#endif
247245

246+
#ifndef __cplusplus
247+
248248
#define __ctype_lookup(__c) (__CTYPE_PTR + 1)[(int) (__c)]
249249

250250
#define isalpha(__c) (__ctype_lookup(__c)&(_U|_L))

0 commit comments

Comments
 (0)