Commit 06bf1a9deaa781b711c4d3718561e7faf303a842

driver1998 2019-04-28T03:21:44

fix x86/x64 MSVC build (#487)

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>