1 diff -Nur libffi-3.0.8/Makefile.am dllize-3.0.8/Makefile.am
2 --- libffi-3.0.8/Makefile.am 2008-02-21 13:36:18.000000000 +0000
3 +++ dllize-3.0.8/Makefile.am 2009-06-05 17:41:33.000000000 +0100
6 AM_CFLAGS = -Wall -g -fexceptions
8 -libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
9 +libffi_la_LDFLAGS = $(LIBFFI_LDFLAGS) -version-info `grep -v '^\#' $(srcdir)/libtool-version`
11 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
12 AM_CCASFLAGS = $(AM_CPPFLAGS)
13 diff -Nur libffi-3.0.8/configure.ac dllize-3.0.8/configure.ac
14 --- libffi-3.0.8/configure.ac 2008-12-19 16:12:30.000000000 +0000
15 +++ dllize-3.0.8/configure.ac 2009-06-05 17:41:33.000000000 +0100
22 +AC_SUBST(LIBFFI_DLL,0)
25 + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
26 + if test "$enable_shared" = yes; then
27 + LIBFFI_LDFLAGS="-no-undefined -Wl,--export-all-symbols"
32 +AC_SUBST(LIBFFI_LDFLAGS)
37 diff -Nur libffi-3.0.8/include/ffi.h.in dllize-3.0.8/include/ffi.h.in
38 --- libffi-3.0.8/include/ffi.h.in 2008-04-03 19:57:34.000000000 +0100
39 +++ dllize-3.0.8/include/ffi.h.in 2009-06-05 17:41:33.000000000 +0100
46 +#define __FFI_DECLSPEC __declspec(__dllexport__)
48 +#define __FFI_DECLSPEC __declspec(__dllimport__)
51 +#define __FFI_DECLSPEC
55 /* ---- System configuration information --------------------------------- */
57 #include <ffitarget.h>
62 -void ffi_raw_call (ffi_cif *cif,
67 -void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
68 -void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
69 -size_t ffi_raw_size (ffi_cif *cif);
70 +__FFI_DECLSPEC void ffi_raw_call (ffi_cif *cif,
75 +__FFI_DECLSPEC void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
76 +__FFI_DECLSPEC void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
77 +__FFI_DECLSPEC size_t ffi_raw_size (ffi_cif *cif);
79 /* This is analogous to the raw API, except it uses Java parameter */
80 /* packing, even on 64-bit machines. I.e. on 64-bit machines */
81 /* longs and doubles are followed by an empty 64-bit word. */
83 -void ffi_java_raw_call (ffi_cif *cif,
86 - ffi_java_raw *avalue);
88 -void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
89 -void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args);
90 -size_t ffi_java_raw_size (ffi_cif *cif);
91 +__FFI_DECLSPEC void ffi_java_raw_call (ffi_cif *cif,
94 + ffi_java_raw *avalue);
96 +__FFI_DECLSPEC void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
97 +__FFI_DECLSPEC void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args);
98 +__FFI_DECLSPEC size_t ffi_java_raw_size (ffi_cif *cif);
100 /* ---- Definitions for closures ----------------------------------------- */
102 @@ -256,16 +267,16 @@
104 } ffi_closure __attribute__((aligned (8)));
106 -void *ffi_closure_alloc (size_t size, void **code);
107 -void ffi_closure_free (void *);
108 +__FFI_DECLSPEC void *ffi_closure_alloc (size_t size, void **code);
109 +__FFI_DECLSPEC void ffi_closure_free (void *);
112 +__FFI_DECLSPEC ffi_status
113 ffi_prep_closure (ffi_closure*,
115 void (*fun)(ffi_cif*,void*,void**,void*),
119 +__FFI_DECLSPEC ffi_status
120 ffi_prep_closure_loc (ffi_closure*,
122 void (*fun)(ffi_cif*,void*,void**,void*),
123 @@ -314,26 +325,26 @@
125 } ffi_java_raw_closure;
128 +__FFI_DECLSPEC ffi_status
129 ffi_prep_raw_closure (ffi_raw_closure*,
131 void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
135 +__FFI_DECLSPEC ffi_status
136 ffi_prep_raw_closure_loc (ffi_raw_closure*,
138 void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
143 +__FFI_DECLSPEC ffi_status
144 ffi_prep_java_raw_closure (ffi_java_raw_closure*,
146 void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
150 +__FFI_DECLSPEC ffi_status
151 ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
153 void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
154 @@ -344,16 +355,16 @@
156 /* ---- Public interface definition -------------------------------------- */
158 -ffi_status ffi_prep_cif(ffi_cif *cif,
160 - unsigned int nargs,
162 - ffi_type **atypes);
164 -void ffi_call(ffi_cif *cif,
168 +__FFI_DECLSPEC ffi_status ffi_prep_cif(ffi_cif *cif,
170 + unsigned int nargs,
172 + ffi_type **atypes);
174 +__FFI_DECLSPEC void ffi_call(ffi_cif *cif,
179 /* Useful for eliminating compiler warnings */
180 #define FFI_FN(f) ((void (*)(void))f)
181 diff -Nur libffi-3.0.8/include/ffi_common.h dllize-3.0.8/include/ffi_common.h
182 --- libffi-3.0.8/include/ffi_common.h 2008-07-12 06:43:00.000000000 +0100
183 +++ dllize-3.0.8/include/ffi_common.h 2009-06-05 17:41:33.000000000 +0100
188 -void ffi_assert(char *expr, char *file, int line);
189 -void ffi_stop_here(void);
190 -void ffi_type_test(ffi_type *a, char *file, int line);
191 +__FFI_DECLSPEC void ffi_assert(char *expr, char *file, int line);
192 +__FFI_DECLSPEC void ffi_stop_here(void);
193 +__FFI_DECLSPEC void ffi_type_test(ffi_type *a, char *file, int line);
195 #define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__))
196 #define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l)))
198 #define ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
200 /* Perform machine dependent cif processing */
201 -ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
202 +__FFI_DECLSPEC ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
204 /* Extended cif, used in callback from assembly routine */
206 diff -Nur libffi-3.0.8/src/x86/win32.S dllize-3.0.8/src/x86/win32.S
207 --- libffi-3.0.8/src/x86/win32.S 2008-02-15 01:24:06.000000000 +0000
208 +++ dllize-3.0.8/src/x86/win32.S 2009-06-05 17:41:33.000000000 +0100
213 -.globl ffi_prep_args
215 # This assumes we are using gas.
217 .globl _ffi_call_SYSV