aboutsummaryrefslogtreecommitdiff
path: root/ports/mman/mman-static.patch
blob: ce7be4976f28ac2dbb3d9e25812fc05779b8f755 (plain)
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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4696ad4..a72bbce 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,6 +8,10 @@ option (BUILD_TESTS "tests?" OFF)
 set (headers mman.h)
 set (sources mman.c)
 
+if(NOT BUILD_SHARED_LIBS)
+  add_definitions(-DMMANSHARED_EXPORT=)
+endif()
+
 add_library (mman ${sources})
 
 install (TARGETS mman RUNTIME DESTINATION bin
diff --git a/mman.h b/mman.h
index 4065bc6..435ea26 100644
--- a/mman.h
+++ b/mman.h
@@ -15,11 +15,13 @@
 #include <_mingw.h>
 #endif
 
+#if !defined(MMANSHARED_EXPORT)
 #if defined(MMAN_LIBRARY)
 #define MMANSHARED_EXPORT __declspec(dllexport)
 #else
 #define MMANSHARED_EXPORT __declspec(dllimport)
 #endif
+#endif
 
 /* Determine offset type */
 #include <stdint.h>