[Pcre-svn] [322] code/trunk: Craig's patch to pcrecpp. cc to…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [322] code/trunk: Craig's patch to pcrecpp. cc to restore ABI compatibility with pre-7.6 versions,
Revision: 322
          http://vcs.pcre.org/viewvc?view=rev&revision=322
Author:   ph10
Date:     2008-03-05 17:14:08 +0000 (Wed, 05 Mar 2008)


Log Message:
-----------
Craig's patch to pcrecpp.cc to restore ABI compatibility with pre-7.6 versions,
which defined a global no_arg variable instead of putting it in the RE class.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcrecpp.cc


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2008-03-05 17:10:45 UTC (rev 321)
+++ code/trunk/ChangeLog    2008-03-05 17:14:08 UTC (rev 322)
@@ -7,6 +7,10 @@
 1.  Applied Craig's patch to sort out a long long problem: "If we can't convert
     a string to a long long, pretend we don't even have a long long." This is 
     done by checking for the strtoq, strtoll, and _strtoi64 functions.
+    
+2.  Applied Craig's patch to pcrecpp.cc to restore ABI compatibility with
+    pre-7.6 versions, which defined a global no_arg variable instead of putting
+    it in the RE class.



Version 7.6 28-Jan-08

Modified: code/trunk/pcrecpp.cc
===================================================================
--- code/trunk/pcrecpp.cc    2008-03-05 17:10:45 UTC (rev 321)
+++ code/trunk/pcrecpp.cc    2008-03-05 17:14:08 UTC (rev 322)
@@ -57,6 +57,14 @@
 // Special object that stands-in for no argument
 Arg RE::no_arg((void*)NULL);


+// This is for ABI compatibility with old versions of pcre (pre-7.6),
+// which defined a global no_arg variable instead of putting it in the
+// RE class. This works on GCC >= 3, at least. We could probably have
+// a more inclusive test if we ever needed it.
+#if defined(__GNUC__) && __GNUC__ >= 3
+extern Arg no_arg __attribute__((alias("_ZN7pcrecpp2RE6no_argE")));
+#endif
+
// If a regular expression has no error, its error_ field points here
static const string empty_string;