X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ffcce508e88937b0bc93ac2ec6071e3eee8b03d..bed6fe0c16ea3f54fffb8797432c36ae355ba765:/src/regex/regcustom.h?ds=inline diff --git a/src/regex/regcustom.h b/src/regex/regcustom.h index ddc99fe722..a53cf621ca 100644 --- a/src/regex/regcustom.h +++ b/src/regex/regcustom.h @@ -50,13 +50,13 @@ #endif #if !wxUSE_UNICODE -# define wx_wchar char +# define wx_wchar char #else // Unicode #if (defined(__GNUC__) && !wxCHECK_GCC_VERSION(2, 96)) - # define wx_wchar __WCHAR_TYPE__ + # define wx_wchar __WCHAR_TYPE__ #else // __WCHAR_TYPE__ and gcc < 2.96 // standard case - # define wx_wchar wchar_t + # define wx_wchar wchar_t #endif // __WCHAR_TYPE__ #endif // ASCII/Unicode @@ -80,18 +80,34 @@ typedef long celt; /* type to hold chr, MCCE number, or /* RN - the "not use sizeof() thing is really annoying!" */ #if wxUSE_UNICODE -# define CHRBITS 32 -# define CHR_MAX 0xfffffffe /* CHR_MAX-CHR_MIN+1 should fit in uchr */ -#else -# define CHRBITS 8 /* bits in a chr; must not use sizeof */ -# define CHR_MAX 0xfe -#endif +# if defined(__WINDOWS__) +# define CHRBITS 16 +# define CHR_MAX 0xfffe +# else /* !__WINDOWS__ */ +# if defined(__MACH__) +# define CHRBITS 32 +# define CHR_MAX 0xfffffffe +# else /* !__MACH__ */ +# if !defined(SIZEOF_WCHAR_T) +# define CHRBITS 16 +# define CHR_MAX 0xfffe +# else /* defined(SIZEOF_WCHAR_T) */ +# define CHRBITS SIZEOF_WCHAR_T +# define CHR_MAX ((1 << CHRBITS) - 1) +# endif /* !defined(SIZEOF_WCHAR_T) */ +# endif /* defined(__MACH__) */ +# endif /* defined(__WINDOWS__) */ +#else /* !wxUSE_UNICODE */ +# define CHRBITS 8 /* bits in a chr; must not use sizeof */ +# define CHR_MAX 0xfe +#endif /* wxUSE_UNICODE */ + #define CHR_MIN 0x00000000 /* smallest and largest chr; the value */ /* PUTTING PARENTHASES AROUND THIS, I.E. (1 << CHRBITS) WILL CAUSE ALL CHARACTERS TO BE MATCHED!!! */ -/*#define CHR_MAX 1 << CHRBITS /*0xfffffffe*/ /* CHR_MAX-CHR_MIN+1 should fit in uchr */ +/*#define CHR_MAX 1 << CHRBITS / CHR_MAX-CHR_MIN+1 should fit in uchr */ /* functions operating on chr */