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