+typedef wxChar chr; /* the type itself */
+typedef int pchr; /* what it promotes to */
+typedef unsigned uchr; /* unsigned type that will hold a chr */
+typedef int celt; /* type to hold chr, MCCE number, or NOCELT */
+#define NOCELT (-1) /* celt value which is not valid chr or MCCE */
+#define UCHAR(c) ((unsigned char) (c))
+#define CHR(c) (UCHAR(c)) /* turn char literal into chr literal */
+#define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */
+#if !wxUSE_UNICODE
+# define CHRBITS 8 /* bits in a chr; must not use sizeof */
+# define CHR_MIN 0x00 /* smallest and largest chr; the value */
+# define CHR_MAX 0xff /* CHR_MAX-CHR_MIN+1 should fit in uchr */
+#elif SIZEOF_WCHAR_T == 4
+# define CHRBITS 32 /* bits in a chr; must not use sizeof */
+# define CHR_MIN 0x00000000 /* smallest and largest chr; the value */
+# define CHR_MAX 0xffffffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */
+#else
+# define CHRBITS 16 /* bits in a chr; must not use sizeof */
+# define CHR_MIN 0x0000 /* smallest and largest chr; the value */
+# define CHR_MAX 0xffff /* CHR_MAX-CHR_MIN+1 should fit in uchr */
+#endif
+
+/*
+ * I'm using isalpha et al. instead of wxIsalpha since BCC 5.5's iswalpha
+ * seems not to work on Windows 9x? Note that these are only used by the
+ * lexer, and although they must work for wxChars, they need only return
+ * true for characters within the ascii range.
+ */
+#define iscalnum(x) ((wxUChar)(x) < 128 && isalnum(x))
+#define iscalpha(x) ((wxUChar)(x) < 128 && isalpha(x))
+#define iscdigit(x) ((wxUChar)(x) < 128 && isdigit(x))
+#define iscspace(x) ((wxUChar)(x) < 128 && isspace(x))