#include <string.h>
+#undef __MINGW_IMPORT
+#define __MINGW_IMPORT
#include <ctype.h>
#undef _pctype
+/* MS's CRT header defines all that, and we actually implement that */
+#undef iswalnum
+#undef __isascii
+#undef iswascii
+#undef __iscsym
+#undef __iscsymf
+#undef iswalpha
+#undef iswcntrl
+#undef iswdigit
+#undef iswgraph
+#undef iswprint
+#undef iswpunct
+#undef iswlower
+#undef iswupper
+#undef iswspace
+#undef iswxdigit
+#undef __toascii
+
#define upalpha ('A' - 'a')
0 /* 0xff */
};
-unsigned short *_pctype = _ctype + 1;
-unsigned short *_pwctype = _ctype + 1;
+const unsigned short *_pctype = _ctype + 1;
+const unsigned short *_pwctype = _ctype + 1;
/*
* @implemented
*/
-unsigned short **__p__pctype(void)
+const unsigned short **__p__pctype(void)
{
return &_pctype;
}
/*
* @implemented
*/
-unsigned short **__p__pwctype(void)
+const unsigned short **__p__pwctype(void)
{
return &_pwctype;
}
*/
int __iscsym(int c)
{
- return(isalnum(c)||(c == '_'));
+ return (c < 127 && (isalnum(c) || (c == '_')));
}
/*
*/
int __iscsymf(int c)
{
- return(isalpha(c)||(c == '_'));
+ return (c < 127 && (isalpha(c) || (c == '_')));
}
/*
/*
* @implemented
*/
-wchar_t towlower(wchar_t c)
+wint_t towlower(wint_t c)
{
if (iswctype (c, _UPPER))
return (c - upalpha);
/*
* @implemented
*/
-wchar_t towupper(wchar_t c)
+wint_t towupper(wint_t c)
{
if (iswctype (c, _LOWER))
return (c + upalpha);