Fix C++ breakage introduced in d7ef4b73
authorTony Cook <tony@develop-help.com>
Thu, 2 Dec 2010 12:03:57 +0000 (23:03 +1100)
committerTony Cook <tony@develop-help.com>
Thu, 2 Dec 2010 12:03:57 +0000 (23:03 +1100)
C++ doesn't allow goto or switch to bypass initialized variable
declarations.  Also fix the function pointer type.

regexec.c

index ffa2da4..d21614f 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -3931,11 +3931,15 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
               named buffers just convert to the equivalent numbered and
               pretend they were called as the corresponding numbered buffer
               op.  */
+           /* don't initialize these, it makes C++ unhappy */
            char *s;
            char type;
-           I32 (*folder)() = NULL;     /* NULL assumes will be NREF, REF: no
-                                          folding */
-           const U8 * fold_array = NULL;
+           re_fold_t folder;
+           const U8 *fold_array;
+
+           folder = NULL;      /* NULL assumes will be NREF, REF: no
+                                  folding */
+           fold_array = NULL;
 
            PL_reg_flags |= RF_tainted;
            folder = foldEQ_locale;