R/R-2.14.1-Adapt-to-PCRE-8.30...

36 lines
1.1 KiB
Diff

From f849075205ac15da7ad9bd3fbe81ca08af053fbe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 14 Feb 2012 14:40:22 +0100
Subject: [PATCH] Adapt to PCRE 8.30
PCRE 8.30 renamed private function _pcre_valid_utf8() to
_pcre_valid_utf().
---
src/main/util.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/src/main/util.c b/src/main/util.c
index 13ce259..c1eb572 100644
--- a/src/main/util.c
+++ b/src/main/util.c
@@ -1258,7 +1258,15 @@ Rboolean mbcsValid(const char *str)
#include "pcre.h"
/* This changed at 8.13: we don't allow < 8.0 */
-#if PCRE_MAJOR > 8 || PCRE_MINOR >= 13
+#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);
+}
+#elif PCRE_MAJOR > 8 || PCRE_MINOR >= 13
extern int _pcre_valid_utf8(const char *string, int length, int *erroroffset);
Rboolean utf8Valid(const char *str)
--
1.7.7.6