47 lines
1.1 KiB
Diff
47 lines
1.1 KiB
Diff
|
From 0af40c757f083cc12988effb46da5313cd042f00 Mon Sep 17 00:00:00 2001
|
||
|
From: David Mitchell <davem@iabyn.com>
|
||
|
Date: Mon, 5 Sep 2016 15:49:28 +0100
|
||
|
Subject: [PATCH] toke.c: fix mswin32 builds
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
9bde56224 added this as part of macro:
|
||
|
|
||
|
- PL_last_lop_op = f; \
|
||
|
+ PL_last_lop_op = f < 0 ? -f : f; \
|
||
|
|
||
|
which broke win32 builds due to this
|
||
|
|
||
|
UNIBRACK(-OP_ENTEREVAL)
|
||
|
|
||
|
expanding to
|
||
|
|
||
|
PL_last_lop_op = -345 < 0 ? --345 : -345
|
||
|
|
||
|
and the -- being seen as a pre-dec op.
|
||
|
|
||
|
Diagnosed by Dagfinn Ilmari Mannsåker.
|
||
|
|
||
|
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||
|
---
|
||
|
toke.c | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/toke.c b/toke.c
|
||
|
index 2350703..a1cdda8 100644
|
||
|
--- a/toke.c
|
||
|
+++ b/toke.c
|
||
|
@@ -241,7 +241,7 @@ static const char* const lex_state_names[] = {
|
||
|
if (have_x) PL_expect = x; \
|
||
|
PL_bufptr = s; \
|
||
|
PL_last_uni = PL_oldbufptr; \
|
||
|
- PL_last_lop_op = f < 0 ? -f : f; \
|
||
|
+ PL_last_lop_op = (f) < 0 ? -(f) : (f); \
|
||
|
if (*s == '(') \
|
||
|
return REPORT( (int)FUNC1 ); \
|
||
|
s = skipspace(s); \
|
||
|
--
|
||
|
2.7.4
|
||
|
|