This commit is contained in:
Alon Zakai 2011-10-06 13:42:56 -07:00
Родитель e1d3e13791
Коммит c7e10b85b5
1 изменённых файлов: 22 добавлений и 22 удалений

Просмотреть файл

@ -30,23 +30,23 @@ int _EXFUN(toascii, (int __c));
#define _toupper(__c) ((unsigned char)(__c) - 'a' + 'A')
#endif
/* XXX Emscripten - these confuse libc++
#define _U 01
#define _L 02
#define _N 04
#define _S 010
#define _P 020
#define _C 040
#define _X 0100
#define _B 0200
*/
#ifndef _MB_CAPABLE
_CONST
#endif
extern __IMPORT char *__ctype_ptr__;
#ifndef __cplusplus
/* XXX Emscripten - these confuse libc++. moved to inside ifndef __cplusplus, and added CTYPE_ */
#define CTYPE__U 01
#define CTYPE__L 02
#define CTYPE__N 04
#define CTYPE__S 010
#define CTYPE__P 020
#define CTYPE__C 040
#define CTYPE__X 0100
#define CTYPE__B 0200
/* These macros are intentionally written in a manner that will trigger
a gcc -Wall warning if the user mistakenly passes a 'char' instead
of an int containing an 'unsigned char'. Note that the sizeof will
@ -58,17 +58,17 @@ extern __IMPORT char *__ctype_ptr__;
an out-of-bounds reference on a 64-bit machine. */
#define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])
#define isalpha(__c) (__ctype_lookup(__c)&(_U|_L))
#define isupper(__c) ((__ctype_lookup(__c)&(_U|_L))==_U)
#define islower(__c) ((__ctype_lookup(__c)&(_U|_L))==_L)
#define isdigit(__c) (__ctype_lookup(__c)&_N)
#define isxdigit(__c) (__ctype_lookup(__c)&(_X|_N))
#define isspace(__c) (__ctype_lookup(__c)&_S)
#define ispunct(__c) (__ctype_lookup(__c)&_P)
#define isalnum(__c) (__ctype_lookup(__c)&(_U|_L|_N))
#define isprint(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N|_B))
#define isgraph(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N))
#define iscntrl(__c) (__ctype_lookup(__c)&_C)
#define isalpha(__c) (__ctype_lookup(__c)&(CTYPE__U|CTYPE__L))
#define isupper(__c) ((__ctype_lookup(__c)&(CTYPE__U|CTYPE__L))==CTYPE__U)
#define islower(__c) ((__ctype_lookup(__c)&(CTYPE__U|CTYPE__L))==CTYPE__L)
#define isdigit(__c) (__ctype_lookup(__c)&CTYPE__N)
#define isxdigit(__c) (__ctype_lookup(__c)&(CTYPE__X|CTYPE__N))
#define isspace(__c) (__ctype_lookup(__c)&CTYPE__S)
#define ispunct(__c) (__ctype_lookup(__c)&CTYPE__P)
#define isalnum(__c) (__ctype_lookup(__c)&(CTYPE__U|CTYPE__L|CTYPE__N))
#define isprint(__c) (__ctype_lookup(__c)&(CTYPE__P|CTYPE__U|CTYPE__L|CTYPE__N|CTYPE__B))
#define isgraph(__c) (__ctype_lookup(__c)&(CTYPE__P|CTYPE__U|CTYPE__L|CTYPE__N))
#define iscntrl(__c) (__ctype_lookup(__c)&CTYPE__C)
#if defined(__GNUC__) && \
(!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L)