wok-current view R/stuff/pcre.u @ rev 22884
updated gsettings-desktop-schemas again (3.28.1 -> 3.34.0)
author | Hans-G?nter Theisgen |
---|---|
date | Sat Feb 22 16:44:15 2020 +0100 (2020-02-22) |
parents | |
children |
line source
1 Fix for pcre-8.30 and above
3 --- src/main/util.c.orig 2012-02-09 17:15:08.000000000 +0000
4 +++ src/main/util.c 2012-02-09 17:20:31.000000000 +0000
5 @@ -1257,8 +1257,18 @@
6 }
8 #include "pcre.h"
9 +
10 +/* This changed at 8.30 */
11 +#if PCRE_MAJOR > 8 || PCRE_MINOR >= 30
12 +extern int _pcre_valid_utf(const char *string, int length, int *erroroffset);
13 +
14 +Rboolean utf8Valid(const char *str)
15 +{
16 + int errp;
17 + return (_pcre_valid_utf(str, (int) strlen(str), &errp) == 0);
18 +}
19 /* This changed at 8.13: we don't allow < 8.0 */
20 -#if PCRE_MAJOR > 8 || PCRE_MINOR >= 13
21 +#elif PCRE_MAJOR > 8 || PCRE_MINOR >= 13
22 extern int _pcre_valid_utf8(const char *string, int length, int *erroroffset);
24 Rboolean utf8Valid(const char *str)
25 @@ -1266,7 +1276,7 @@
26 int errp;
27 return (_pcre_valid_utf8(str, (int) strlen(str), &errp) == 0);
28 }
29 -#else
30 +#else
31 extern int _pcre_valid_utf8(const char *string, int length);
33 Rboolean utf8Valid(const char *str)