summaryrefslogtreecommitdiff
path: root/libffi/include/ffi_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'libffi/include/ffi_common.h')
-rw-r--r--libffi/include/ffi_common.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/libffi/include/ffi_common.h b/libffi/include/ffi_common.h
index 6af4b5f21fa..16c5f8859f7 100644
--- a/libffi/include/ffi_common.h
+++ b/libffi/include/ffi_common.h
@@ -18,7 +18,10 @@ extern "C" {
/* Do not move this. Some versions of AIX are very picky about where
this is positioned. */
#ifdef __GNUC__
+/* mingw64 defines this already in malloc.h. */
+#ifndef alloca
# define alloca __builtin_alloca
+#endif
# define MAYBE_UNUSED __attribute__((__unused__))
#else
# define MAYBE_UNUSED
@@ -29,7 +32,11 @@ extern "C" {
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
+# ifdef _MSC_VER
+# define alloca _alloca
+# else
char *alloca ();
+# endif
# endif
# endif
# endif
@@ -77,6 +84,16 @@ typedef struct
} extended_cif;
/* Terse sized type definitions. */
+#ifdef _MSC_VER
+typedef unsigned char UINT8;
+typedef signed char SINT8;
+typedef unsigned short UINT16;
+typedef signed short SINT16;
+typedef unsigned int UINT32;
+typedef signed int SINT32;
+typedef unsigned __int64 UINT64;
+typedef signed __int64 SINT64;
+#else
typedef unsigned int UINT8 __attribute__((__mode__(__QI__)));
typedef signed int SINT8 __attribute__((__mode__(__QI__)));
typedef unsigned int UINT16 __attribute__((__mode__(__HI__)));
@@ -85,6 +102,7 @@ typedef unsigned int UINT32 __attribute__((__mode__(__SI__)));
typedef signed int SINT32 __attribute__((__mode__(__SI__)));
typedef unsigned int UINT64 __attribute__((__mode__(__DI__)));
typedef signed int SINT64 __attribute__((__mode__(__DI__)));
+#endif
typedef float FLOAT32;