1 --- libffi-3.0.6/include/ffi.h.in 2008-04-03 20:57:34.000000000 +0200
2 +++ build/include/ffi.h.in 2008-10-14 09:51:55.000000000 +0200
9 +#define __FFI_DECLSPEC __declspec(__dllexport__)
11 +#define __FFI_DECLSPEC __declspec(__dllimport__)
14 +#define __FFI_DECLSPEC
18 /* ---- System configuration information --------------------------------- */
20 #include <ffitarget.h>
25 -void ffi_raw_call (ffi_cif *cif,
30 -void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
31 -void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
32 -size_t ffi_raw_size (ffi_cif *cif);
33 +__FFI_DECLSPEC void ffi_raw_call (ffi_cif *cif,
38 +__FFI_DECLSPEC void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
39 +__FFI_DECLSPEC void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
40 +__FFI_DECLSPEC size_t ffi_raw_size (ffi_cif *cif);
42 /* This is analogous to the raw API, except it uses Java parameter */
43 /* packing, even on 64-bit machines. I.e. on 64-bit machines */
44 /* longs and doubles are followed by an empty 64-bit word. */
46 -void ffi_java_raw_call (ffi_cif *cif,
49 - ffi_java_raw *avalue);
51 -void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
52 -void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args);
53 -size_t ffi_java_raw_size (ffi_cif *cif);
54 +__FFI_DECLSPEC void ffi_java_raw_call (ffi_cif *cif,
57 + ffi_java_raw *avalue);
59 +__FFI_DECLSPEC void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
60 +__FFI_DECLSPEC void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args);
61 +__FFI_DECLSPEC size_t ffi_java_raw_size (ffi_cif *cif);
63 /* ---- Definitions for closures ----------------------------------------- */
67 } ffi_closure __attribute__((aligned (8)));
69 -void *ffi_closure_alloc (size_t size, void **code);
70 -void ffi_closure_free (void *);
71 +__FFI_DECLSPEC void *ffi_closure_alloc (size_t size, void **code);
72 +__FFI_DECLSPEC void ffi_closure_free (void *);
75 +__FFI_DECLSPEC ffi_status
76 ffi_prep_closure (ffi_closure*,
78 void (*fun)(ffi_cif*,void*,void**,void*),
82 +__FFI_DECLSPEC ffi_status
83 ffi_prep_closure_loc (ffi_closure*,
85 void (*fun)(ffi_cif*,void*,void**,void*),
88 } ffi_java_raw_closure;
91 +__FFI_DECLSPEC ffi_status
92 ffi_prep_raw_closure (ffi_raw_closure*,
94 void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
98 +__FFI_DECLSPEC ffi_status
99 ffi_prep_raw_closure_loc (ffi_raw_closure*,
101 void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
106 +__FFI_DECLSPEC ffi_status
107 ffi_prep_java_raw_closure (ffi_java_raw_closure*,
109 void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
113 +__FFI_DECLSPEC ffi_status
114 ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
116 void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
117 @@ -344,16 +355,16 @@
119 /* ---- Public interface definition -------------------------------------- */
121 -ffi_status ffi_prep_cif(ffi_cif *cif,
123 - unsigned int nargs,
125 - ffi_type **atypes);
127 -void ffi_call(ffi_cif *cif,
131 +__FFI_DECLSPEC ffi_status ffi_prep_cif(ffi_cif *cif,
133 + unsigned int nargs,
135 + ffi_type **atypes);
137 +__FFI_DECLSPEC void ffi_call(ffi_cif *cif,
142 /* Useful for eliminating compiler warnings */
143 #define FFI_FN(f) ((void (*)(void))f)
144 --- build/Makefile.am 2008-02-21 14:21:24.000000000 +0100
145 +++ build-shared/Makefile.am 2008-10-11 20:44:15.000000000 +0200
148 AM_CFLAGS = -Wall -g -fexceptions
150 -libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
151 +libffi_la_LDFLAGS = $(LIBFFI_LDFLAGS) -version-info `grep -v '^\#' $(srcdir)/libtool-version`
153 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
154 AM_CCASFLAGS = $(AM_CPPFLAGS)
155 --- build/src/x86/win32.S 2008-02-15 02:17:20.000000000 +0100
156 +++ build-shared/src/x86/win32.S 2008-10-11 19:19:03.000000000 +0200
161 -.globl ffi_prep_args
163 # This assumes we are using gas.
165 .globl _ffi_call_SYSV
167 --- build/include/ffi_common.h 2008-01-29 16:15:17.000000000 +0100
168 +++ build-shared/include/ffi_common.h 2008-10-13 00:35:02.000000000 +0200
173 -void ffi_assert(char *expr, char *file, int line);
174 -void ffi_stop_here(void);
175 -void ffi_type_test(ffi_type *a, char *file, int line);
176 +__FFI_DECLSPEC void ffi_assert(char *expr, char *file, int line);
177 +__FFI_DECLSPEC void ffi_stop_here(void);
178 +__FFI_DECLSPEC void ffi_type_test(ffi_type *a, char *file, int line);
180 #define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__))
181 #define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l)))
183 #define ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
185 /* Perform machine dependent cif processing */
186 -ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
187 +__FFI_DECLSPEC ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
189 /* Extended cif, used in callback from assembly routine */
191 --- build/configure.ac 2008-02-24 18:20:21.000000000 +0100
192 +++ build-shared/configure.ac 2008-10-13 19:20:04.000000000 +0200
198 +AC_LIBTOOL_WIN32_DLL
199 +AC_SUBST(LIBFFI_DLL,0)
202 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
203 + if test "$enable_shared" = yes; then
204 + LIBFFI_LDFLAGS="-no-undefined -Wl,--export-all-symbols"
209 +AC_SUBST(LIBFFI_LDFLAGS)