X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2a68dd9e19a208018d8b95bbfe4fb6bb70c89798..de2ce07c7a13f9b0800c8f9e68adadebdc9aa89c:/src/regex/regcustom.h diff --git a/src/regex/regcustom.h b/src/regex/regcustom.h index 43aff31f7a..8f51782d53 100644 --- a/src/regex/regcustom.h +++ b/src/regex/regcustom.h @@ -1,3 +1,6 @@ +#ifndef _REGEX_CUSTOM_H_ +#define _REGEX_CUSTOM_H_ + /* * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. * @@ -30,35 +33,28 @@ /* headers if any */ -// FreeBSD, Watcom and DMars require this, CW doesn't have nor need it. -// Others also don't seem to need it. If you have an error related to -// (not) including please report details to -// wx-dev@lists.wxwindows.org +/* FreeBSD, Watcom and DMars require this, CW doesn't have nor need it. */ +/* Others also don't seem to need it. If you have an error related to */ +/* (not) including please report details to */ +/* wx-dev@lists.wxwindows.org */ #if defined(__UNIX__) || defined(__WATCOMC__) || defined(__DIGITALMARS__) # include #endif #include #include +#include #include #include -#ifndef wxCHECK_GCC_VERSION -#define wxCHECK_GCC_VERSION( major, minor ) \ - ( defined(__GNUC__) && defined(__GNUC_MINOR__) \ - && ( ( __GNUC__ > (major) ) \ - || ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) ) -#endif -#if !wxUSE_UNICODE -# define wx_wchar char -#else // Unicode - #if (defined(__GNUC__) && !wxCHECK_GCC_VERSION(2, 96)) - # define wx_wchar __WCHAR_TYPE__ - #else // __WCHAR_TYPE__ and gcc < 2.96 - // standard case - # define wx_wchar wchar_t - #endif // __WCHAR_TYPE__ -#endif // ASCII/Unicode +#include "wx/wxchar.h" + +/** +* +* wx_wchar == wxChar +* +*/ +#define wx_wchar wxChar /* overrides for regguts.h definitions, if any */ #define FUNCPTR(name, args) (*name) args @@ -78,37 +74,15 @@ typedef long celt; /* type to hold chr, MCCE number, or * literal */ #define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */ -/* RN - the "not use sizeof() thing is really annoying!" */ -#if wxUSE_UNICODE -# 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 */ - +#if wxUSE_WCHAR_T +# define CHRBITS (SIZEOF_WCHAR_T << 3) /* bits in a chr; must not use sizeof */ +# define CHR_MAX ((1 << CHRBITS) - 1) +# define CHR_MIN 0x00000000 /* smallest and largest chr; the value */ +#else /*ANSI*/ +# define CHRBITS 8 +# define CHR_MAX 0xFF +# define CHR_MIN 0x00 +#endif /*wxUSE_WCHAR_T*/ /* functions operating on chr */ #define iscalnum(x) wx_isalnum(x) @@ -116,5 +90,9 @@ typedef long celt; /* type to hold chr, MCCE number, or #define iscdigit(x) wx_isdigit(x) #define iscspace(x) wx_isspace(x) +extern int wx_strlen(const wx_wchar* szString); + /* and pick up the standard header */ #include "regex.h" + +#endif /* _REGEX_CUSTOM_H_ */