summaryrefslogtreecommitdiff
path: root/ext/ffi_c/libffi/include/ffi.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ffi_c/libffi/include/ffi.h.in')
-rw-r--r--ext/ffi_c/libffi/include/ffi.h.in94
1 files changed, 77 insertions, 17 deletions
diff --git a/ext/ffi_c/libffi/include/ffi.h.in b/ext/ffi_c/libffi/include/ffi.h.in
index f5a29b0..f403ae0 100644
--- a/ext/ffi_c/libffi/include/ffi.h.in
+++ b/ext/ffi_c/libffi/include/ffi.h.in
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------*-C-*-
- libffi @VERSION@ - Copyright (c) 2011 Anthony Green
+ libffi @VERSION@ - Copyright (c) 2011, 2014 Anthony Green
- Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person
@@ -68,7 +68,7 @@ extern "C" {
#ifndef LIBFFI_ASM
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(__clang__)
#define __attribute__(X)
#endif
@@ -166,25 +166,49 @@ typedef struct _ffi_type
#error "long size not supported"
#endif
+/* Need minimal decorations for DLLs to works on Windows. */
+/* GCC has autoimport and autoexport. Rely on Libtool to */
+/* help MSVC export from a DLL, but always declare data */
+/* to be imported for MSVC clients. This costs an extra */
+/* indirection for MSVC clients using the static version */
+/* of the library, but don't worry about that. Besides, */
+/* as a workaround, they can define FFI_BUILDING if they */
+/* *know* they are going to link with the static library. */
+#if defined _MSC_VER && !defined FFI_BUILDING
+#define FFI_EXTERN extern __declspec(dllimport)
+#else
+#define FFI_EXTERN extern
+#endif
+
/* These are defined in types.c */
-extern ffi_type ffi_type_void;
-extern ffi_type ffi_type_uint8;
-extern ffi_type ffi_type_sint8;
-extern ffi_type ffi_type_uint16;
-extern ffi_type ffi_type_sint16;
-extern ffi_type ffi_type_uint32;
-extern ffi_type ffi_type_sint32;
-extern ffi_type ffi_type_uint64;
-extern ffi_type ffi_type_sint64;
-extern ffi_type ffi_type_float;
-extern ffi_type ffi_type_double;
-extern ffi_type ffi_type_pointer;
+FFI_EXTERN ffi_type ffi_type_void;
+FFI_EXTERN ffi_type ffi_type_uint8;
+FFI_EXTERN ffi_type ffi_type_sint8;
+FFI_EXTERN ffi_type ffi_type_uint16;
+FFI_EXTERN ffi_type ffi_type_sint16;
+FFI_EXTERN ffi_type ffi_type_uint32;
+FFI_EXTERN ffi_type ffi_type_sint32;
+FFI_EXTERN ffi_type ffi_type_uint64;
+FFI_EXTERN ffi_type ffi_type_sint64;
+FFI_EXTERN ffi_type ffi_type_float;
+FFI_EXTERN ffi_type ffi_type_double;
+FFI_EXTERN ffi_type ffi_type_pointer;
#if @HAVE_LONG_DOUBLE@
-extern ffi_type ffi_type_longdouble;
+FFI_EXTERN ffi_type ffi_type_longdouble;
#else
#define ffi_type_longdouble ffi_type_double
#endif
+
+#ifdef FFI_TARGET_HAS_COMPLEX_TYPE
+FFI_EXTERN ffi_type ffi_type_complex_float;
+FFI_EXTERN ffi_type ffi_type_complex_double;
+#if @HAVE_LONG_DOUBLE@
+FFI_EXTERN ffi_type ffi_type_complex_longdouble;
+#else
+#define ffi_type_complex_longdouble ffi_type_complex_double
+#endif
+#endif
#endif /* LIBFFI_HIDE_BASIC_TYPES */
typedef enum {
@@ -207,6 +231,20 @@ typedef struct {
#endif
} ffi_cif;
+#if @HAVE_LONG_DOUBLE_VARIANT@
+/* Used to adjust size/alignment of ffi types. */
+void ffi_prep_types (ffi_abi abi);
+#endif
+
+/* Used internally, but overridden by some architectures */
+ffi_status ffi_prep_cif_core(ffi_cif *cif,
+ ffi_abi abi,
+ unsigned int isvariadic,
+ unsigned int nfixedargs,
+ unsigned int ntotalargs,
+ ffi_type *rtype,
+ ffi_type **atypes);
+
/* ---- Definitions for the raw API -------------------------------------- */
#ifndef FFI_SIZEOF_ARG
@@ -274,7 +312,12 @@ size_t ffi_java_raw_size (ffi_cif *cif);
__declspec(align(8))
#endif
typedef struct {
+#if @FFI_EXEC_TRAMPOLINE_TABLE@
+ void *trampoline_table;
+ void *trampoline_table_entry;
+#else
char tramp[FFI_TRAMPOLINE_SIZE];
+#endif
ffi_cif *cif;
void (*fun)(ffi_cif*,void*,void**,void*);
void *user_data;
@@ -307,8 +350,12 @@ ffi_prep_closure_loc (ffi_closure*,
# pragma pack 8
#endif
typedef struct {
+#if @FFI_EXEC_TRAMPOLINE_TABLE@
+ void *trampoline_table;
+ void *trampoline_table_entry;
+#else
char tramp[FFI_TRAMPOLINE_SIZE];
-
+#endif
ffi_cif *cif;
#if !FFI_NATIVE_RAW_API
@@ -328,7 +375,12 @@ typedef struct {
} ffi_raw_closure;
typedef struct {
+#if @FFI_EXEC_TRAMPOLINE_TABLE@
+ void *trampoline_table;
+ void *trampoline_table_entry;
+#else
char tramp[FFI_TRAMPOLINE_SIZE];
+#endif
ffi_cif *cif;
@@ -384,6 +436,13 @@ ffi_status ffi_prep_cif(ffi_cif *cif,
ffi_type *rtype,
ffi_type **atypes);
+ffi_status ffi_prep_cif_var(ffi_cif *cif,
+ ffi_abi abi,
+ unsigned int nfixedargs,
+ unsigned int ntotalargs,
+ ffi_type *rtype,
+ ffi_type **atypes);
+
void ffi_call(ffi_cif *cif,
void (*fn)(void),
void *rvalue,
@@ -416,9 +475,10 @@ void ffi_call(ffi_cif *cif,
#define FFI_TYPE_SINT64 12
#define FFI_TYPE_STRUCT 13
#define FFI_TYPE_POINTER 14
+#define FFI_TYPE_COMPLEX 15
/* This should always refer to the last type code (for sanity checks) */
-#define FFI_TYPE_LAST FFI_TYPE_POINTER
+#define FFI_TYPE_LAST FFI_TYPE_COMPLEX
#ifdef __cplusplus
}