OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / libffi / include / ffi.h.in
index 5f4c1c1..92e38c4 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------*-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
@@ -57,7 +57,9 @@ extern "C" {
 #endif
 
 /* Specify which architecture libffi is configured for. */
+#ifndef @TARGET@
 #define @TARGET@
+#endif
 
 /* ---- System configuration information --------------------------------- */
 
@@ -65,6 +67,10 @@ extern "C" {
 
 #ifndef LIBFFI_ASM
 
+#ifdef _MSC_VER
+#define __attribute__(X)
+#endif
+
 #include <stddef.h>
 #include <limits.h>
 
@@ -222,7 +228,7 @@ typedef ffi_raw ffi_java_raw;
 
 
 void ffi_raw_call (ffi_cif *cif,
-                  void (*fn)(),
+                  void (*fn)(void),
                   void *rvalue,
                   ffi_raw *avalue);
 
@@ -235,7 +241,7 @@ size_t ffi_raw_size (ffi_cif *cif);
 /* 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);
 
@@ -247,12 +253,19 @@ size_t ffi_java_raw_size (ffi_cif *cif);
 
 #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 *);
@@ -349,12 +362,12 @@ ffi_status ffi_prep_cif(ffi_cif *cif,
                        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 ---------------------------- */