From 8368298acf5c578b88887f19f7fba519bbc12296 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Thu, 2 Dec 2010 23:03:57 +1100 Subject: [PATCH] Fix C++ breakage introduced in d7ef4b73 C++ doesn't allow goto or switch to bypass initialized variable declarations. Also fix the function pointer type. --- regexec.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/regexec.c b/regexec.c index ffa2da4..d21614f 100644 --- 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; -- 2.7.4