This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
libffi 3.2.1 and master, can't build with Visual Studio 2012
- From: GrÃgory Pakosz <gpakosz at myscript dot com>
- To: "libffi-discuss at sourceware dot org" <libffi-discuss at sourceware dot org>
- Cc: "nield dot a dot d at gmail dot com" <nield dot a dot d at gmail dot com>, "rth at twiddle dot net" <rth at twiddle dot net>
- Date: Tue, 18 Nov 2014 15:23:25 +0000
- Subject: libffi 3.2.1 and master, can't build with Visual Studio 2012
- Authentication-results: sourceware.org; auth=none
âHello,
I would like to inform you it's not possible to build libffi 3.2.1Âwith Visual Studio 2012 anymore as it's not a C99 compiler.
In src/x86/ffi.c,Â
 -Âsrc/x86/ffi.c doesn't compile because
  -Âcommit 098dca6b31e declares "size_t z" variables not at the beginning of blocks whichÂis possible in C99 only
  - commit 5d6340ef2cf8 moves "int i" variable declaration from beginning to middle of block
  - this appears to be fixed in master by commit b21ec1ce783â though
- for libffi master branch, starting with commit b9ac94f3af9b1c, the now uses designated initializers, e.g:
static const struct abi_params abi_params[FFI_LAST_ABI] = {
[FFI_SYSV] = { 1, 0 },
[FFI_THISCALL] = { 1, 1, { R_ECX } },
[FFI_FASTCALL] = { 1, 2, { R_ECX, R_EDX } },
[FFI_STDCALL] = { 1, 0 },
[FFI_PASCAL] = { -1, 0 },
[FFI_REGISTER] = { -1, 3, { R_EAX, R_EDX, R_ECX } },
[FFI_MS_CDECL] = { 1, 0 }
};
What do you think? Do you want to impose compiling libffi with a C99 compiler?
Regards,
Gregory
PS: The problems mentioned happen independently of the recent questions around Visual Studio supporting C99's complex types.