1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
diff --git a/src/types.c b/src/types.c
index 0de5994..46c8d18 100644
--- a/src/types.c
+++ b/src/types.c
@@ -31,6 +31,12 @@
#include <ffi.h>
#include <ffi_common.h>
+#ifdef FFI_EXPORT_DATA
+#define FFI_EXPORT __declspec(dllexport)
+#else
+#define FFI_EXPORT
+#endif
+
/* Type definitions */
#define FFI_TYPEDEF(name, type, id) \
@@ -38,7 +44,7 @@ struct struct_align_##name { \
char c; \
type x; \
}; \
-const ffi_type ffi_type_##name = { \
+FFI_EXPORT const ffi_type ffi_type_##name = { \
sizeof(type), \
offsetof(struct struct_align_##name, x), \
id, NULL \
@@ -56,7 +62,7 @@ ffi_type ffi_type_##name = { \
}
/* Size and alignment are fake here. They must not be 0. */
-const ffi_type ffi_type_void = {
+FFI_EXPORT const ffi_type ffi_type_void = {
1, 1, FFI_TYPE_VOID, NULL
};
|