1212extern "C" {
1313#endif
1414
15- #ifndef _WCTYPE_T_DEFINED
16- #define _WCTYPE_T_DEFINED
17- typedef unsigned short wint_t ;
18- typedef unsigned short wctype_t ;
19- #endif /* _WCTYPE_T_DEFINED */
20-
2115#ifndef WEOF
2216#define WEOF (wint_t)(0xFFFF)
2317#endif
2418
25- #ifndef _CRT_CTYPEDATA_DEFINED
26- #define _CRT_CTYPEDATA_DEFINED
2719#ifndef _CTYPE_DISABLE_MACROS
20+ _CRTIMP const unsigned short * __cdecl __pctype_func (void );
21+ _CRTIMP const wctype_t * __cdecl __pwctype_func (void );
2822
2923#ifndef __PCTYPE_FUNC
3024#define __PCTYPE_FUNC __pctype_func()
31- _CRTIMP const unsigned short * __pctype_func (void );
3225#endif
3326
3427#ifndef _pctype
3528#define _pctype (__pctype_func())
3629#endif
3730
38- #endif
39- #endif
40-
41- #ifndef _CRT_WCTYPEDATA_DEFINED
42- #define _CRT_WCTYPEDATA_DEFINED
43- #ifndef _CTYPE_DISABLE_MACROS
44- #if !defined(_wctype ) && defined(_CRT_USE_WINAPI_FAMILY_DESKTOP_APP )
45- extern const unsigned short * * __MINGW_IMP_SYMBOL (_wctype );
46- #define _wctype (* __MINGW_IMP_SYMBOL(_wctype))
47- #endif
48-
49- _CRTIMP const wctype_t * __cdecl __pwctype_func (void );
5031#ifndef _pwctype
5132#define _pwctype (__pwctype_func())
5233#endif
53- #endif
34+ #endif /* !_CTYPE_DISABLE_MACROS */
35+
36+ #if __MSVCRT_VERSION__ >= 0x0600
37+ #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
38+ extern _CRTIMP const unsigned short * _wctype ;
39+ #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
5440#endif
5541
5642#define _UPPER 0x1
@@ -66,95 +52,128 @@ extern "C" {
6652#define _LEADBYTE 0x8000
6753#define _ALPHA (0x0100|_UPPER|_LOWER)
6854
69- #ifndef _WCTYPE_DEFINED
70- #define _WCTYPE_DEFINED
71-
72- _CRTIMP int __cdecl iswalpha (wint_t _C );
73- _CRTIMP int __cdecl iswupper (wint_t _C );
74- _CRTIMP int __cdecl iswlower (wint_t _C );
75- _CRTIMP int __cdecl iswdigit (wint_t _C );
76- _CRTIMP int __cdecl iswxdigit (wint_t _C );
77- _CRTIMP int __cdecl iswspace (wint_t _C );
78- _CRTIMP int __cdecl iswpunct (wint_t _C );
79- _CRTIMP int __cdecl iswalnum (wint_t _C );
80- _CRTIMP int __cdecl iswprint (wint_t _C );
81- _CRTIMP int __cdecl iswgraph (wint_t _C );
82- _CRTIMP int __cdecl iswcntrl (wint_t _C );
83- _CRTIMP int __cdecl iswascii (wint_t _C );
84- #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
85- _CRTIMP int __cdecl isleadbyte (int _C );
86- #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
87- _CRTIMP wint_t __cdecl towupper (wint_t _C );
88- _CRTIMP wint_t __cdecl towlower (wint_t _C );
89- _CRTIMP int __cdecl iswctype (wint_t _C ,wctype_t _Type );
90- _CRTIMP int __cdecl __iswcsymf (wint_t _C );
91- _CRTIMP int __cdecl __iswcsym (wint_t _C );
92- _CRTIMP int __cdecl iswblank (wint_t _C );
93- #if __MSVCRT_VERSION__ >= 0x800 || (__MSVCRT_VERSION__ == 0x600 && _WIN32_WINNT >= 0x0600 )
94- /* These are available since msvcr80.dll (__MSVCRT_VERSION__ >= 0x800), and in
95- * msvcrt.dll (__MSVCRT_VERSION__ == 0x600) since Vista (_WIN32_WINNT >= 0x0600). */
96- _CRTIMP int __cdecl _iswalpha_l (wint_t _C ,_locale_t _Locale );
97- _CRTIMP int __cdecl _iswupper_l (wint_t _C ,_locale_t _Locale );
98- _CRTIMP int __cdecl _iswlower_l (wint_t _C ,_locale_t _Locale );
99- _CRTIMP int __cdecl _iswdigit_l (wint_t _C ,_locale_t _Locale );
100- _CRTIMP int __cdecl _iswxdigit_l (wint_t _C ,_locale_t _Locale );
101- _CRTIMP int __cdecl _iswspace_l (wint_t _C ,_locale_t _Locale );
102- _CRTIMP int __cdecl _iswpunct_l (wint_t _C ,_locale_t _Locale );
103- _CRTIMP int __cdecl _iswalnum_l (wint_t _C ,_locale_t _Locale );
104- _CRTIMP int __cdecl _iswprint_l (wint_t _C ,_locale_t _Locale );
105- _CRTIMP int __cdecl _iswgraph_l (wint_t _C ,_locale_t _Locale );
106- _CRTIMP int __cdecl _iswcntrl_l (wint_t _C ,_locale_t _Locale );
107- _CRTIMP wint_t __cdecl _towupper_l (wint_t _C ,_locale_t _Locale );
108- _CRTIMP wint_t __cdecl _towlower_l (wint_t _C ,_locale_t _Locale );
109- # ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
110- _CRTIMP int __cdecl _isleadbyte_l (int _C ,_locale_t _Locale );
111- # endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
112- _CRTIMP int __cdecl _iswctype_l (wint_t _C ,wctype_t _Type ,_locale_t _Locale );
113- _CRTIMP int __cdecl _iswblank_l (wint_t _C ,_locale_t _Locale );
114- #endif
115- #if __MSVCRT_VERSION__ >= 0x800
116- /* These are only available since msvcr80.dll, never in msvcrt.dll. */
117- _CRTIMP int __cdecl _iswcsymf_l (wint_t _C ,_locale_t _Locale );
118- _CRTIMP int __cdecl _iswcsym_l (wint_t _C ,_locale_t _Locale );
55+ /**
56+ * Standard C functions.
57+ */
58+
59+ _CRTIMP int __cdecl iswctype (wint_t _C ,wctype_t _Type );
60+
61+ _CRTIMP int __cdecl iswalnum (wint_t _C );
62+ _CRTIMP int __cdecl iswalpha (wint_t _C );
63+ _CRTIMP int __cdecl iswblank (wint_t _C );
64+ _CRTIMP int __cdecl iswcntrl (wint_t _C );
65+ _CRTIMP int __cdecl iswdigit (wint_t _C );
66+ _CRTIMP int __cdecl iswgraph (wint_t _C );
67+ _CRTIMP int __cdecl iswlower (wint_t _C );
68+ _CRTIMP int __cdecl iswprint (wint_t _C );
69+ _CRTIMP int __cdecl iswpunct (wint_t _C );
70+ _CRTIMP int __cdecl iswspace (wint_t _C );
71+ _CRTIMP int __cdecl iswupper (wint_t _C );
72+ _CRTIMP int __cdecl iswxdigit (wint_t _C );
73+
74+ _CRTIMP wint_t __cdecl towlower (wint_t _C );
75+ _CRTIMP wint_t __cdecl towupper (wint_t _C );
76+
77+ #if !defined(_CTYPE_DISABLE_MACROS ) && !defined(__cplusplus )
78+ #define iswalnum (_c ) (iswctype(_c,_ALPHA|_DIGIT))
79+ #define iswalpha (_c ) (iswctype(_c,_ALPHA))
80+ #define iswblank (_c ) (((_c) == '\t') || iswctype(_c,_BLANK))
81+ #define iswcntrl (_c ) (iswctype(_c,_CONTROL))
82+ #define iswdigit (_c ) (iswctype(_c,_DIGIT))
83+ #define iswgraph (_c ) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
84+ #define iswlower (_c ) (iswctype(_c,_LOWER))
85+ #define iswprint (_c ) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
86+ #define iswpunct (_c ) (iswctype(_c,_PUNCT))
87+ #define iswspace (_c ) (iswctype(_c,_SPACE))
88+ #define iswupper (_c ) (iswctype(_c,_UPPER))
89+ #define iswxdigit (_c ) (iswctype(_c,_HEX))
90+ #endif /* !_CTYPE_DISABLE_MACROS && !__cplusplus */
91+
92+ /**
93+ * Locale-specific versions of Standard C functions.
94+ *
95+ * They are available since msvcr80.dll.
96+ */
97+
98+ /* These are also available in msvcrt.dll since Windows Vista. */
99+ #if __MSVCRT_VERSION__ >= 0x0800 || (__MSVCRT_VERSION__ == 0x0600 && _WIN32_WINNT >= 0x0600 )
100+ _CRTIMP int __cdecl _iswctype_l (wint_t _C ,wctype_t _Type ,_locale_t _Locale );
101+
102+ _CRTIMP int __cdecl _iswalnum_l (wint_t _C ,_locale_t _Locale );
103+ _CRTIMP int __cdecl _iswalpha_l (wint_t _C ,_locale_t _Locale );
104+ _CRTIMP int __cdecl _iswblank_l (wint_t _C ,_locale_t _Locale );
105+ _CRTIMP int __cdecl _iswcntrl_l (wint_t _C ,_locale_t _Locale );
106+ _CRTIMP int __cdecl _iswdigit_l (wint_t _C ,_locale_t _Locale );
107+ _CRTIMP int __cdecl _iswgraph_l (wint_t _C ,_locale_t _Locale );
108+ _CRTIMP int __cdecl _iswlower_l (wint_t _C ,_locale_t _Locale );
109+ _CRTIMP int __cdecl _iswprint_l (wint_t _C ,_locale_t _Locale );
110+ _CRTIMP int __cdecl _iswpunct_l (wint_t _C ,_locale_t _Locale );
111+ _CRTIMP int __cdecl _iswspace_l (wint_t _C ,_locale_t _Locale );
112+ _CRTIMP int __cdecl _iswupper_l (wint_t _C ,_locale_t _Locale );
113+ _CRTIMP int __cdecl _iswxdigit_l (wint_t _C ,_locale_t _Locale );
114+
115+ _CRTIMP wint_t __cdecl _towlower_l (wint_t _C ,_locale_t _Locale );
116+ _CRTIMP wint_t __cdecl _towupper_l (wint_t _C ,_locale_t _Locale );
117+
118+ #if !defined(_CTYPE_DISABLE_MACROS ) && !defined(__cplusplus )
119+ #define _iswalnum_l (_c ,_p ) (_iswctype_l(_c,_ALPHA|_DIGIT,_p))
120+ #define _iswalpha_l (_c ,_p ) (_iswctype_l(_c,_ALPHA,_p))
121+ #define _iswblank_l (_c ,_p ) (((_c) == '\t') || _iswctype_l(_c,_BLANK,_p))
122+ #define _iswcntrl_l (_c ,_p ) (_iswctype_l(_c,_CONTROL,_p))
123+ #define _iswdigit_l (_c ,_p ) (_iswctype_l(_c,_DIGIT,_p))
124+ #define _iswgraph_l (_c ,_p ) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p))
125+ #define _iswlower_l (_c ,_p ) (_iswctype_l(_c,_LOWER,_p))
126+ #define _iswprint_l (_c ,_p ) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p))
127+ #define _iswpunct_l (_c ,_p ) (_iswctype_l(_c,_PUNCT,_p))
128+ #define _iswspace_l (_c ,_p ) (_iswctype_l(_c,_SPACE,_p))
129+ #define _iswupper_l (_c ,_p ) (_iswctype_l(_c,_UPPER,_p))
130+ #define _iswxdigit_l (_c ,_p ) (_iswctype_l(_c,_HEX,_p))
131+ #endif /* !_CTYPE_DISABLE_MACROS && !__cplusplus */
119132#endif
133+
134+ /**
135+ * Microsoft-specific functions.
136+ */
137+
138+ _CRTIMP int __cdecl __iswcsym (wint_t _C );
139+ _CRTIMP int __cdecl __iswcsymf (wint_t _C );
140+ _CRTIMP int __cdecl iswascii (wint_t _C );
141+
142+ /* These are only available for Desktop applications. */
120143#ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
121- _CRTIMP int __cdecl is_wctype (wint_t _C ,wctype_t _Type );
144+ _CRTIMP int __cdecl is_wctype (wint_t _C ,wctype_t _Type );
145+ _CRTIMP int __cdecl isleadbyte (int _C );
122146#endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
123- #endif
124147
125- #ifndef _WCTYPE_INLINE_DEFINED
126- #define _WCTYPE_INLINE_DEFINED
148+ #if !defined(_CTYPE_DISABLE_MACROS ) && !defined(__cplusplus )
149+ #define __iswcsym (_c ) (iswalnum(_c) || ((_c)=='_'))
150+ #define __iswcsymf (_c ) (iswalpha(_c) || ((_c)=='_'))
151+ #define iswascii (_c ) ((unsigned)(_c) < 0x80)
152+ #endif /* !_CTYPE_DISABLE_MACROS && !__cplusplus */
127153
128- #undef _CRT_WCTYPE_NOINLINE
129- #ifndef __cplusplus
130- #define iswalpha (_c ) (iswctype(_c,_ALPHA))
131- #define iswupper (_c ) (iswctype(_c,_UPPER))
132- #define iswlower (_c ) (iswctype(_c,_LOWER))
133- #define iswdigit (_c ) (iswctype(_c,_DIGIT))
134- #define iswxdigit (_c ) (iswctype(_c,_HEX))
135- #define iswspace (_c ) (iswctype(_c,_SPACE))
136- #define iswpunct (_c ) (iswctype(_c,_PUNCT))
137- #define iswalnum (_c ) (iswctype(_c,_ALPHA|_DIGIT))
138- #define iswprint (_c ) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
139- #define iswgraph (_c ) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
140- #define iswcntrl (_c ) (iswctype(_c,_CONTROL))
141- #define iswascii (_c ) ((unsigned)(_c) < 0x80)
142- #define iswblank (_c ) (((_c) == '\t') || iswctype(_c,_BLANK))
143- #if __MSVCRT_VERSION__ >= 0x800 || (__MSVCRT_VERSION__ == 0x600 && _WIN32_WINNT >= 0x0600 )
144- # define _iswalpha_l (_c ,_p ) (_iswctype_l(_c,_ALPHA,_p))
145- # define _iswupper_l (_c ,_p ) (_iswctype_l(_c,_UPPER,_p))
146- # define _iswlower_l (_c ,_p ) (_iswctype_l(_c,_LOWER,_p))
147- # define _iswdigit_l (_c ,_p ) (_iswctype_l(_c,_DIGIT,_p))
148- # define _iswxdigit_l (_c ,_p ) (_iswctype_l(_c,_HEX,_p))
149- # define _iswspace_l (_c ,_p ) (_iswctype_l(_c,_SPACE,_p))
150- # define _iswpunct_l (_c ,_p ) (_iswctype_l(_c,_PUNCT,_p))
151- # define _iswalnum_l (_c ,_p ) (_iswctype_l(_c,_ALPHA|_DIGIT,_p))
152- # define _iswprint_l (_c ,_p ) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p))
153- # define _iswgraph_l (_c ,_p ) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p))
154- # define _iswcntrl_l (_c ,_p ) (_iswctype_l(_c,_CONTROL,_p))
155- # define _iswblank_l (_c ,_p ) (((_c) == '\t') || _iswctype_l(_c,_BLANK,_p))
156- #endif /* __MSVCRT_VERSION__ >= 0x800 */
154+ /**
155+ * Locale-specific versions of Microsoft functions.
156+ *
157+ * They are available since msvcr80.dll.
158+ */
159+
160+ /* These are only available since msvcr80.dll, never in msvcrt.dll. */
161+ #if __MSVCRT_VERSION__ >= 0x0800
162+ _CRTIMP int __cdecl _iswcsym_l (wint_t _C ,_locale_t _Locale );
163+ _CRTIMP int __cdecl _iswcsymf_l (wint_t _C ,_locale_t _Locale );
164+
165+ #if !defined(_CTYPE_DISABLE_MACROS ) && !defined(__cplusplus )
166+ #define _iswcsym_l (_c ,_p ) (_iswalnum_l(_c,_p) || ((_c)=='_'))
167+ #define _iswcsymf_l (_c ,_p ) (_iswalpha_l(_c,_p) || ((_c)=='_'))
168+ #endif /* !_CTYPE_DISABLE_MACROS && !__cplusplus */
157169#endif
170+
171+ /* These are also available in msvcrt.dll since Windows Vista. */
172+ #if __MSVCRT_VERSION__ >= 0x0800 || (__MSVCRT_VERSION__ == 0x0600 && _WIN32_WINNT >= 0x0600 )
173+ /* These are only available for Desktop applications. */
174+ #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
175+ _CRTIMP int __cdecl _isleadbyte_l (int _C ,_locale_t _Locale );
176+ #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
158177#endif
159178
160179#ifdef __cplusplus
0 commit comments