# HG changeset patch # User Pascal Bellard # Date 1357553024 -3600 # Node ID 1e5a0f0c11cf244b90fecc6acf0143bb4bd40a56 # Parent efe6d158ca020dae57fb84b43422700b47a49555 R: update pcre code diff -r efe6d158ca02 -r 1e5a0f0c11cf R/receipt --- a/R/receipt Mon Jan 07 11:02:00 2013 +0100 +++ b/R/receipt Mon Jan 07 11:03:44 2013 +0100 @@ -19,6 +19,7 @@ export R_PDFVIEWER="epdfview" unset DESTDIR cd $src + patch -p 0 < $stuff/pcre.u ./configure \ --enable-R-shlib \ --with-system-zlib \ diff -r efe6d158ca02 -r 1e5a0f0c11cf R/stuff/pcre.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/R/stuff/pcre.u Mon Jan 07 11:03:44 2013 +0100 @@ -0,0 +1,33 @@ +Fix for pcre-8.30 and above + +--- src/main/util.c.orig 2012-02-09 17:15:08.000000000 +0000 ++++ src/main/util.c 2012-02-09 17:20:31.000000000 +0000 +@@ -1257,8 +1257,18 @@ + } + + #include "pcre.h" ++ ++/* This changed at 8.30 */ ++#if PCRE_MAJOR > 8 || PCRE_MINOR >= 30 ++extern int _pcre_valid_utf(const char *string, int length, int *erroroffset); ++ ++Rboolean utf8Valid(const char *str) ++{ ++ int errp; ++ return (_pcre_valid_utf(str, (int) strlen(str), &errp) == 0); ++} + /* This changed at 8.13: we don't allow < 8.0 */ +-#if PCRE_MAJOR > 8 || PCRE_MINOR >= 13 ++#elif PCRE_MAJOR > 8 || PCRE_MINOR >= 13 + extern int _pcre_valid_utf8(const char *string, int length, int *erroroffset); + + Rboolean utf8Valid(const char *str) +@@ -1266,7 +1276,7 @@ + int errp; + return (_pcre_valid_utf8(str, (int) strlen(str), &errp) == 0); + } +-#else ++#else + extern int _pcre_valid_utf8(const char *string, int length); + + Rboolean utf8Valid(const char *str)