This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Put back the cygwin32 Configure fix of 3582 undone by 3597.
[perl5.git] / regcomp.h
index 1a139c5..7c5c13a 100644 (file)
--- a/regcomp.h
+++ b/regcomp.h
@@ -187,17 +187,17 @@ struct regnode_2 {
 #endif /* lint */
 
 #define        FAIL(m) \
-    STMT_START {                                       \
-       /*if (!SIZE_ONLY)                               \
-           ReREFCNT_dec(PL_regcomp_rx);*/              \
-       croak    ("/%.127s/: %s",  PL_regprecomp,m);    \
+    STMT_START {                                                       \
+       if (!SIZE_ONLY)                                                 \
+           SAVEDESTRUCTOR(S_clear_re,(void*)PL_regcomp_rx);            \
+       Perl_croak(aTHX_ "/%.127s/: %s",  PL_regprecomp,m);             \
     } STMT_END
 
 #define        FAIL2(pat,m) \
-    STMT_START {                                       \
-       /*if (!SIZE_ONLY)                               \
-           ReREFCNT_dec(PL_regcomp_rx);*/              \
-       re_croak2("/%.127s/: ",pat,PL_regprecomp,m);    \
+    STMT_START {                                                       \
+       if (!SIZE_ONLY)                                                 \
+           SAVEDESTRUCTOR(S_clear_re,(void*)PL_regcomp_rx);            \
+       S_re_croak2(aTHX_ "/%.127s/: ",pat,PL_regprecomp,m);            \
     } STMT_END
 
 #define EXTRA_SIZE(guy) ((sizeof(guy)-1)/sizeof(struct regnode))
@@ -207,6 +207,8 @@ struct regnode_2 {
 #define REG_SEEN_GPOS          4
 #define REG_SEEN_EVAL          8
 
+START_EXTERN_C
+
 #include "regnodes.h"
 
 /* The following have no fixed length. char* since we do strchr on it. */
@@ -234,3 +236,4 @@ EXTCONST char PL_simple[] = {
 };
 #endif
 
+END_EXTERN_C