wok-current view R/stuff/pcre.u @ rev 13824
R: update pcre code
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jan 07 11:03:44 2013 +0100 (2013-01-07) |
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)