Avoid defining the same global between perl and re.pm
authorTony Cook <tony@develop-help.com>
Sun, 19 Feb 2012 10:55:50 +0000 (21:55 +1100)
committerTony Cook <tony@develop-help.com>
Sun, 19 Feb 2012 23:31:14 +0000 (10:31 +1100)
This caused -Uusedl builds to fail due to the duplicate symbol.

A more complex fix can be expected after 5.16.

regcomp.c

index a996049..dd5a37c 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -86,7 +86,9 @@
 #endif
 
 #include "dquote_static.c"
-#include "charclass_invlists.h"
+#ifndef PERL_IN_XSUB_RE
+#  include "charclass_invlists.h"
+#endif
 
 #ifdef op
 #undef op
@@ -4814,6 +4816,7 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 orig_pm_flags)
 
     DEBUG_r(if (!PL_colorset) reginitcolors());
 
+#ifndef PERL_IN_XSUB_RE
     /* Initialize these here instead of as-needed, as is quick and avoids
      * having to test them each time otherwise */
     if (! PL_AboveLatin1) {
@@ -4869,6 +4872,7 @@ Perl_re_compile(pTHX_ SV * const pattern, U32 orig_pm_flags)
        PL_PosixXDigit = _new_invlist_C_array(PosixXDigit_invlist);
        PL_XPosixXDigit = _new_invlist_C_array(XPosixXDigit_invlist);
     }
+#endif
 
     exp = SvPV(pattern, plen);