summaryrefslogtreecommitdiff
path: root/include/mbgl/util/util.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/util/util.hpp')
-rw-r--r--include/mbgl/util/util.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/mbgl/util/util.hpp b/include/mbgl/util/util.hpp
index 7960b40299..52d9ad85b7 100644
--- a/include/mbgl/util/util.hpp
+++ b/include/mbgl/util/util.hpp
@@ -19,3 +19,26 @@
#else
#define MBGL_CONSTEXPR inline
#endif
+
+// Compiler defines for making symbols visible, otherwise they
+// will be defined as hidden by default.
+
+// clang-format off
+#if defined WIN32
+ #ifdef MBGL_BUILDING_LIB
+ #ifdef __GNUC__
+ #define MBGL_EXPORT __attribute__((dllexport))
+ #else
+ #define MBGL_EXPORT __declspec(dllexport)
+ #endif
+ #else
+ #ifdef __GNUC__
+ #define MBGL_EXPORT __attribute__((dllimport))
+ #else
+ #define MBGL_EXPORT __declspec(dllimport)
+ #endif
+ #endif
+#else
+ #define MBGL_EXPORT __attribute__((visibility ("default"))) // NOLINT
+#endif
+// clang-format on