Skip to content

Commit 3b48af0

Browse files
committed
- Issue #22176: Fix build failure on ARM with -Werror=declaration-after-statement
1 parent 6a66f15 commit 3b48af0

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

Modules/_ctypes/libffi.diff

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,26 @@ diff -urN libffi-3.1/src/dlmalloc.c libffi/src/dlmalloc.c
184184
set_lock(m, locked);
185185
}
186186
return (mspace)m;
187+
diff -urN libffi-3.1/src/arm/ffi.c libffi/src/arm/ffi.c
188+
--- libffi-3.1/src/arm/ffi.c Sat Aug 09 23:52:34 2014 +0200
189+
+++ libffi/src/arm/ffi.c Sat Aug 09 23:58:38 2014 +0200
190+
@@ -154,9 +154,6 @@
191+
192+
int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
193+
{
194+
- // make sure we are using FFI_VFP
195+
- FFI_ASSERT(ecif->cif->abi == FFI_VFP);
196+
-
197+
register unsigned int i, vi = 0;
198+
register void **p_argv;
199+
register char *argp, *regp, *eo_regp;
200+
@@ -165,6 +162,9 @@
201+
char done_with_regs = 0;
202+
char is_vfp_type;
203+
204+
+ // make sure we are using FFI_VFP
205+
+ FFI_ASSERT(ecif->cif->abi == FFI_VFP);
206+
+
207+
/* the first 4 words on the stack are used for values passed in core
208+
* registers. */
209+
regp = stack;

Modules/_ctypes/libffi/src/arm/ffi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space)
154154

155155
int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
156156
{
157-
// make sure we are using FFI_VFP
158-
FFI_ASSERT(ecif->cif->abi == FFI_VFP);
159-
160157
register unsigned int i, vi = 0;
161158
register void **p_argv;
162159
register char *argp, *regp, *eo_regp;
@@ -165,6 +162,9 @@ int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
165162
char done_with_regs = 0;
166163
char is_vfp_type;
167164

165+
// make sure we are using FFI_VFP
166+
FFI_ASSERT(ecif->cif->abi == FFI_VFP);
167+
168168
/* the first 4 words on the stack are used for values passed in core
169169
* registers. */
170170
regp = stack;

0 commit comments

Comments
 (0)