aboutsummaryrefslogtreecommitdiff
path: root/src/common/Define.h
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2016-03-20 00:50:21 +0100
committerNaios <naios-dev@live.de>2016-03-24 02:38:54 +0100
commit2613413608337d61994503df0e2d9ed05d3c4ee4 (patch)
treec560bb1832b8a9aa13837dd662bfb9fa514475f4 /src/common/Define.h
parentf37682b7edd0d711e1120cbdd9d627fb5b9dbde1 (diff)
Core/Build: Add the possibility to link libraries dynamically.
* makes it possible to access exported singletons from other shared lib's. * reduces binary size (cherry picked from commit f4e0945b13a70225684e7421d9542efae6a47c89)
Diffstat (limited to 'src/common/Define.h')
-rw-r--r--src/common/Define.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/common/Define.h b/src/common/Define.h
index b34edb6a549..d03d26ad780 100644
--- a/src/common/Define.h
+++ b/src/common/Define.h
@@ -95,6 +95,45 @@
#endif
#endif //COMPILER == COMPILER_GNU
+#ifdef TRINITY_API_USE_DYNAMIC_LINKING
+# if COMPILER == COMPILER_MICROSOFT
+# define TC_API_EXPORT __declspec(dllexport)
+# define TC_API_IMPORT __declspec(dllimport)
+# elif COMPILER == COMPILER_GNU
+# define TC_API_EXPORT __attribute__((visibility("default")))
+# define TC_API_IMPORT
+# else
+# error compiler not supported!
+# endif
+#else
+# define TC_API_EXPORT
+# define TC_API_IMPORT
+#endif
+
+#ifdef TRINITY_API_EXPORT_COMMON
+# define TC_COMMON_API TC_API_EXPORT
+#else
+# define TC_COMMON_API TC_API_IMPORT
+#endif
+
+#ifdef TRINITY_API_EXPORT_DATABASE
+# define TC_DATABASE_API TC_API_EXPORT
+#else
+# define TC_DATABASE_API TC_API_IMPORT
+#endif
+
+#ifdef TRINITY_API_EXPORT_SHARED
+# define TC_SHARED_API TC_API_EXPORT
+#else
+# define TC_SHARED_API TC_API_IMPORT
+#endif
+
+#ifdef TRINITY_API_EXPORT_GAME
+# define TC_GAME_API TC_API_EXPORT
+#else
+# define TC_GAME_API TC_API_IMPORT
+#endif
+
#define UI64FMTD "%" PRIu64
#define UI64LIT(N) UINT64_C(N)