+#ifndef _REGEX_CUSTOM_H_
+#define _REGEX_CUSTOM_H_
+
/*
* Copyright (c) 1998, 1999 Henry Spencer. All rights reserved.
*
*/
/* headers if any */
-#include <sys/types.h>
+
+/* 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 <sys/types.h> please report details to */
+/* wx-dev@lists.wxwindows.org */
+#if defined(__UNIX__) || defined(__WATCOMC__) || defined(__DIGITALMARS__)
+# include <sys/types.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <ctype.h>
#include <limits.h>
-#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
/* internal character type and related */
typedef wx_wchar chr; /* the type itself */
-typedef unsigned uchr; /* unsigned type that will hold a chr */
-typedef int celt; /* type to hold chr, MCCE number, or
+typedef unsigned long uchr; /* unsigned type that will hold a chr */
+typedef long celt; /* type to hold chr, MCCE number, or
* NOCELT */
#define NOCELT (-1) /* celt value which is not valid chr or
#define CHR(c) ((unsigned char) (c)) /* turn char literal into chr
* literal */
#define DIGITVAL(c) ((c)-'0') /* turn chr digit into its value */
-#define CHRBITS 32 /* bits in a chr; must not use sizeof */
+
+#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 */
-#define CHR_MAX 0xfffffffe /* CHR_MAX-CHR_MIN+1 should fit in uchr */
+
/* functions operating on chr */
#define iscalnum(x) wx_isalnum(x)
#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_ */