/* -----------------------------------------------------------------*-C-*-
- libffi @VERSION@ - Copyright (c) 1996-2003, 2007 Red Hat, Inc.
+ libffi @VERSION@ - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
#endif
/* Specify which architecture libffi is configured for. */
+#ifndef @TARGET@
#define @TARGET@
+#endif
/* ---- System configuration information --------------------------------- */
#ifndef LIBFFI_ASM
+#ifdef _MSC_VER
+#define __attribute__(X)
+#endif
+
#include <stddef.h>
#include <limits.h>
void ffi_raw_call (ffi_cif *cif,
- void (*fn)(),
+ void (*fn)(void),
void *rvalue,
ffi_raw *avalue);
/* longs and doubles are followed by an empty 64-bit word. */
void ffi_java_raw_call (ffi_cif *cif,
- void (*fn)(),
+ void (*fn)(void),
void *rvalue,
ffi_java_raw *avalue);
#if FFI_CLOSURES
+#ifdef _MSC_VER
+__declspec(align(8))
+#endif
typedef struct {
char tramp[FFI_TRAMPOLINE_SIZE];
ffi_cif *cif;
void (*fun)(ffi_cif*,void*,void**,void*);
void *user_data;
+#ifdef __GNUC__
} ffi_closure __attribute__((aligned (8)));
+#else
+} ffi_closure;
+#endif
void *ffi_closure_alloc (size_t size, void **code);
void ffi_closure_free (void *);
ffi_type **atypes);
void ffi_call(ffi_cif *cif,
- void (*fn)(),
+ void (*fn)(void),
void *rvalue,
void **avalue);
/* Useful for eliminating compiler warnings */
-#define FFI_FN(f) ((void (*)())f)
+#define FFI_FN(f) ((void (*)(void))f)
/* ---- Definitions shared with assembly code ---------------------------- */