fix x86/x64 MSVC build (#487)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/.appveyor.yml b/.appveyor.yml
index 3c021a8..1c7fe9b 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -40,7 +40,7 @@ install:
$env:VCVARS_PLATFORM="amd64"
$env:BUILD="x86_64-w64-cygwin"
$env:HOST="x86_64-w64-cygwin"
- $env:ASSEMBLER="/cygdrive/c/projects/libffi/msvcc.sh -m64"
+ $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -m64"
$env:SRC_ARCHITECTURE="x86"
}
- 'appveyor DownloadFile https://cygwin.com/setup-x86.exe -FileName setup.exe'
diff --git a/src/x86/ffi.c b/src/x86/ffi.c
index c6c7d2b..883cc4a 100644
--- a/src/x86/ffi.c
+++ b/src/x86/ffi.c
@@ -29,7 +29,7 @@
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
-#ifdef __i386__
+#if defined(__i386__) || defined(_M_IX86)
#include <ffi.h>
#include <ffi_common.h>
#include <stdint.h>
diff --git a/src/x86/ffiw64.c b/src/x86/ffiw64.c
index ca4d3ca..b68f69c 100644
--- a/src/x86/ffiw64.c
+++ b/src/x86/ffiw64.c
@@ -25,7 +25,7 @@
DEALINGS IN THE SOFTWARE.
----------------------------------------------------------------------- */
-#ifdef __x86_64__
+#if defined(__x86_64__) || defined(_M_AMD64)
#include <ffi.h>
#include <ffi_common.h>
#include <stdlib.h>