summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2010-11-26 11:16:43 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2010-11-26 11:16:43 +0000
commit93cbed6e2bcb419c6f0c425bad6ec4addb52a96a (patch)
tree288f9dd9f882d630f3ca64c57e340bfc6f29713b
parent78d4828aaa1f15dfc4b40c0f718112f6508254f8 (diff)
downloadpcre-93cbed6e2bcb419c6f0c425bad6ec4addb52a96a.tar.gz
Patches to avoid build problems in some Borland environments.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@580 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog3
-rw-r--r--pcre_stringpiece.h.in4
-rw-r--r--pcre_stringpiece_unittest.cc11
-rw-r--r--pcretest.c8
4 files changed, 19 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index ee29ba0..653ebfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -127,6 +127,9 @@ Version 8.11 24-Nov-2010
memory required was incorrectly computed, leading to "Failed: internal
error: code overflow". This has been fixed.
+22. Some patches to pcre_stringpiece.h, pcre_stringpiece_unittest.cc, and
+ pcretest.c, to avoid build problems in some Borland environments.
+
Version 8.10 25-Jun-2010
------------------------
diff --git a/pcre_stringpiece.h.in b/pcre_stringpiece.h.in
index b017661..369c10f 100644
--- a/pcre_stringpiece.h.in
+++ b/pcre_stringpiece.h.in
@@ -38,7 +38,7 @@
#ifndef _PCRE_STRINGPIECE_H
#define _PCRE_STRINGPIECE_H
-#include <string.h>
+#include <cstring>
#include <string>
#include <iosfwd> // for ostream forward-declaration
@@ -52,6 +52,8 @@
#include <pcre.h>
+using std::memcmp;
+using std::strlen;
using std::string;
namespace pcrecpp {
diff --git a/pcre_stringpiece_unittest.cc b/pcre_stringpiece_unittest.cc
index 1e821ab..c58e028 100644
--- a/pcre_stringpiece_unittest.cc
+++ b/pcre_stringpiece_unittest.cc
@@ -24,8 +24,6 @@
} \
} while (0)
-using std::map;
-using std::make_pair;
using pcrecpp::StringPiece;
static void CheckSTLComparator() {
@@ -37,12 +35,13 @@ static void CheckSTLComparator() {
StringPiece p2(s2);
StringPiece p3(s3);
- typedef map<StringPiece, int> TestMap;
+ typedef std::map<StringPiece, int> TestMap;
TestMap map;
- map.insert(make_pair(p1, 0));
- map.insert(make_pair(p2, 1));
- map.insert(make_pair(p3, 2));
+ map.insert(std::make_pair(p1, 0));
+ map.insert(std::make_pair(p2, 1));
+ map.insert(std::make_pair(p3, 2));
+
CHECK(map.size() == 3);
TestMap::const_iterator iter = map.begin();
diff --git a/pcretest.c b/pcretest.c
index fb2a321..87d532e 100644
--- a/pcretest.c
+++ b/pcretest.c
@@ -79,6 +79,14 @@ input mode under Windows. */
#define fileno _fileno
#endif
+/* A user sent this fix for Borland Builder 5 under Windows. */
+
+#ifdef __BORLANDC__
+#define _setmode(handle, mode) setmode(handle, mode)
+#endif
+
+/* Not Windows */
+
#else
#include <sys/time.h> /* These two includes are needed */
#include <sys/resource.h> /* for setrlimit(). */