[Pcre-svn] [580] code/trunk: Patches to avoid build problems…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [580] code/trunk: Patches to avoid build problems in some Borland environments.
Revision: 580
          http://vcs.pcre.org/viewvc?view=rev&revision=580
Author:   ph10
Date:     2010-11-26 11:16:43 +0000 (Fri, 26 Nov 2010)


Log Message:
-----------
Patches to avoid build problems in some Borland environments.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_stringpiece.h.in
    code/trunk/pcre_stringpiece_unittest.cc
    code/trunk/pcretest.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2010-11-24 17:39:25 UTC (rev 579)
+++ code/trunk/ChangeLog    2010-11-26 11:16:43 UTC (rev 580)
@@ -127,7 +127,10 @@
     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
------------------------


Modified: code/trunk/pcre_stringpiece.h.in
===================================================================
--- code/trunk/pcre_stringpiece.h.in    2010-11-24 17:39:25 UTC (rev 579)
+++ code/trunk/pcre_stringpiece.h.in    2010-11-26 11:16:43 UTC (rev 580)
@@ -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 {

Modified: code/trunk/pcre_stringpiece_unittest.cc
===================================================================
--- code/trunk/pcre_stringpiece_unittest.cc    2010-11-24 17:39:25 UTC (rev 579)
+++ code/trunk/pcre_stringpiece_unittest.cc    2010-11-26 11:16:43 UTC (rev 580)
@@ -24,8 +24,6 @@
   }                                                     \
 } while (0)


-using std::map;
-using std::make_pair;
using pcrecpp::StringPiece;

static void CheckSTLComparator() {
@@ -37,12 +35,13 @@
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();

Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2010-11-24 17:39:25 UTC (rev 579)
+++ code/trunk/pcretest.c    2010-11-26 11:16:43 UTC (rev 580)
@@ -79,6 +79,14 @@
 #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(). */