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.
