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
|
From: =?utf-8?q?Timo_R=C3=B6hling?= <timo@gaussglocke.de>
Date: Tue, 24 Nov 2020 10:38:34 +0100
Subject: Add GCC support for compiling with hidden visibility
Forwarded: https://github.com/eProsima/Fast-CDR/pull/89
GCC hidden visibility closely mimics the Windows DLL import/export
feature, which cleans up the symbol export table and leads to faster
startup times as well as a more stable ABI.
---
include/fastcdr/fastcdr_dll.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/fastcdr/fastcdr_dll.h b/include/fastcdr/fastcdr_dll.h
index c355f2f..b6564c5 100644
--- a/include/fastcdr/fastcdr_dll.h
+++ b/include/fastcdr/fastcdr_dll.h
@@ -48,7 +48,11 @@
#define Cdr_DllAPI
#endif // if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTCDR_DYN_LINK)
#else
+#if __GNUC__ >= 4
+#define Cdr_DllAPI __attribute__((visibility("default")))
+#else
#define Cdr_DllAPI
+#endif // if __GNUC__ >= 4
#endif // _WIN32
// Auto linking.
|