Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2413cf1

Browse files
paulmonzooba
authored andcommitted
Patch libffi for Windows (#6)
1 parent 8fa8837 commit 2413cf1

File tree

2 files changed

+1000
-0
lines changed

2 files changed

+1000
-0
lines changed

src/x86/ffi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ ffi_prep_cif_machdep(ffi_cif *cif)
177177
bytes = FFI_ALIGN (bytes, t->alignment);
178178
bytes += FFI_ALIGN (t->size, FFI_SIZEOF_ARG);
179179
}
180+
#if defined(_MSC_VER) && defined(_M_IX86)
181+
// stack is not 16-bit aligned on Windows
182+
cif->bytes = bytes;
183+
#else
180184
cif->bytes = FFI_ALIGN (bytes, 16);
185+
#endif
181186

182187
return FFI_OK;
183188
}

0 commit comments

Comments
 (0)