Subject: | [PATCH] Avoid using anonymous union in struct SuspendedFrame |
Old compilers such as gcc 4.4 (shipped in RHEL 6) don't allow anonymous union or structure members.
Subject: | 0001-Avoid-using-anonymous-union-in-struct-SuspendedFrame.patch |
From c9965d1d110b8979fb9ba4a2e37bec87104d7b77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Thu, 18 Jan 2018 17:23:30 +0000
Subject: [PATCH] Avoid using anonymous union in struct SuspendedFrame
Old compilers such as gcc 4.4 (shipped in RHEL 6) don't allow
anonymous union or structure members.
---
lib/Future/AsyncAwait.xs | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/lib/Future/AsyncAwait.xs b/lib/Future/AsyncAwait.xs
index 62d0931..4194653 100644
--- a/lib/Future/AsyncAwait.xs
+++ b/lib/Future/AsyncAwait.xs
@@ -88,7 +88,7 @@ struct SuspendedFrame {
OP *retop;
} eval;
struct block_loop loop;
- };
+ } el;
#ifdef HAVE_ITERVAR
SV *itervar;
#endif
@@ -478,7 +478,7 @@ static void MY_suspendedstate_suspend(pTHX_ SuspendedState *state, CV *cv)
case CXt_LOOP_PLAIN:
frame->type = type;
- frame->loop = cx->blk_loop;
+ frame->el.loop = cx->blk_loop;
frame->gimme = cx->blk_gimme;
break;
@@ -497,7 +497,7 @@ static void MY_suspendedstate_suspend(pTHX_ SuspendedState *state, CV *cv)
croak("Cannot suspend a foreach loop on non-lexical iterator");
frame->type = type;
- frame->loop = cx->blk_loop;
+ frame->el.loop = cx->blk_loop;
frame->gimme = cx->blk_gimme;
#ifdef HAVE_ITERVAR
@@ -520,13 +520,13 @@ static void MY_suspendedstate_suspend(pTHX_ SuspendedState *state, CV *cv)
/* these two fields are refcounted, so we need to save them from
* dounwind() throwing them away
*/
- SvREFCNT_inc(frame->loop.state_u.lazysv.cur);
- SvREFCNT_inc(frame->loop.state_u.lazysv.end);
+ SvREFCNT_inc(frame->el.loop.state_u.lazysv.cur);
+ SvREFCNT_inc(frame->el.loop.state_u.lazysv.end);
}
#if !HAVE_PERL_VERSION(5, 24, 0)
else if(type == CXt_LOOP_FOR) {
- if(frame->loop.state_u.ary.ary)
- SvREFCNT_inc(frame->loop.state_u.ary.ary);
+ if(frame->el.loop.state_u.ary.ary)
+ SvREFCNT_inc(frame->el.loop.state_u.ary.ary);
}
#endif
@@ -549,7 +549,7 @@ static void MY_suspendedstate_suspend(pTHX_ SuspendedState *state, CV *cv)
frame->type = CXt_EVAL;
frame->gimme = cx->blk_gimme;
- frame->eval.retop = cx->blk_eval.retop;
+ frame->el.eval.retop = cx->blk_eval.retop;
continue;
}
@@ -723,7 +723,7 @@ static void MY_suspendedstate_resume(pTHX_ SuspendedState *state, CV *cv)
case CXt_LOOP_PLAIN:
cx = cx_pushblock(frame->type, frame->gimme, PL_stack_sp, PL_savestack_ix);
/* don't call cx_pushloop_plain() because it will get this wrong */
- cx->blk_loop = frame->loop;
+ cx->blk_loop = frame->el.loop;
break;
#if HAVE_PERL_VERSION(5, 24, 0)
@@ -736,7 +736,7 @@ static void MY_suspendedstate_resume(pTHX_ SuspendedState *state, CV *cv)
case CXt_LOOP_LAZYIV:
cx = cx_pushblock(frame->type, frame->gimme, PL_stack_sp, PL_savestack_ix);
/* don't call cx_pushloop_plain() because it will get this wrong */
- cx->blk_loop = frame->loop;
+ cx->blk_loop = frame->el.loop;
#if HAVE_PERL_VERSION(5, 24, 0)
cx->cx_type |= CXp_FOR_PAD;
#endif
@@ -757,7 +757,7 @@ static void MY_suspendedstate_resume(pTHX_ SuspendedState *state, CV *cv)
case CXt_EVAL:
cx = cx_pushblock(CXt_EVAL|CXp_TRYBLOCK, frame->gimme,
PL_stack_sp, PL_savestack_ix);
- cx_pusheval(cx, frame->eval.retop, NULL);
+ cx_pusheval(cx, frame->el.eval.retop, NULL);
PL_in_eval = EVAL_INEVAL;
CLEAR_ERRSV();
break;
--
2.15.1