Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From 0d88d735887c6f2fa00a743c27124c7a52006a41 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Sun, 15 Apr 2018 19:17:27 -0700 |
| 4 | Subject: [PATCH] fix error caused by a new variable is declared after the |
| 5 | label |
| 6 | |
| 7 | There is a build failure on mips: |
| 8 | ... |
| 9 | |sljitNativeMIPS_common.c: In function 'sljit_has_cpu_feature': |
| 10 | |sljitNativeMIPS_common.c:506:3: error: a label can only be part |
| 11 | of a statement and a declaration is not a statement |
| 12 | | sljit_sw fir; |
| 13 | | ^~~~~~~~ |
| 14 | ... |
| 15 | |
| 16 | Upstream-Status: Pending |
| 17 | |
| 18 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 19 | --- |
| 20 | ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c | 4 +++- |
| 21 | 1 file changed, 3 insertions(+), 1 deletion(-) |
| 22 | |
| 23 | diff --git a/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c b/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c |
| 24 | index ee207fe..adfd342 100644 |
| 25 | --- a/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c |
| 26 | +++ b/ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c |
| 27 | @@ -498,12 +498,14 @@ SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compil |
| 28 | |
| 29 | SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type) |
| 30 | { |
| 31 | +#if defined(__GNUC__) |
| 32 | + sljit_sw fir; |
| 33 | +#endif |
| 34 | switch (feature_type) { |
| 35 | case SLJIT_HAS_FPU: |
| 36 | #ifdef SLJIT_IS_FPU_AVAILABLE |
| 37 | return SLJIT_IS_FPU_AVAILABLE; |
| 38 | #elif defined(__GNUC__) |
| 39 | - sljit_sw fir; |
| 40 | asm ("cfc1 %0, $0" : "=r"(fir)); |
| 41 | return (fir >> 22) & 0x1; |
| 42 | #else |
| 43 | -- |
| 44 | 2.10.2 |
| 45 | |