diff options
Diffstat (limited to 'kjs/regexp.h')
-rw-r--r-- | kjs/regexp.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/kjs/regexp.h b/kjs/regexp.h index 88851260e..e731eb714 100644 --- a/kjs/regexp.h +++ b/kjs/regexp.h @@ -25,13 +25,16 @@ #include "config.h" -#ifdef HAVE_PCREPOSIX -#include <pcre.h> +#ifdef HAVE_PCRE2POSIX +#define PCRE2_CODE_UNIT_WIDTH 8 +#include <pcre2.h> +typedef PCRE2_UCHAR8 buftype_t; #else // POSIX regex - not so good... extern "C" { // bug with some libc5 distributions #include <regex.h> +typedef char buftype_t; } -#endif //HAVE_PCREPOSIX +#endif #include "ustring.h" @@ -61,7 +64,7 @@ namespace KJS { bool valid; // Cached encoding info... - char* buffer; + buftype_t *buffer; int* originalPos; int bufferSize; @@ -71,22 +74,20 @@ namespace KJS { UString originalS; // the original string, used for sanity-checking #endif -#ifndef HAVE_PCREPOSIX +#ifndef HAVE_PCRE2POSIX regex_t preg; #else - pcre *pcregex; + pcre2_code *pcregex; + pcre2_match_data *match_data; enum UTF8SupportState { Unknown, Supported, Unsupported }; - -#ifdef PCRE_CONFIG_UTF8 static UTF8SupportState utf8Support; #endif -#endif - unsigned int nrSubPatterns; + uint32_t nrSubPatterns; RegExp(); }; |