[babeltrace,stable-1.5,2/5] Port: win32 DLLs don't support hidden symbols

Message ID 1486072992-21895-2-git-send-email-mjeanson@efficios.com
State Accepted, archived
Headers show
Series [babeltrace,stable-1.5,1/5] Port: replace strerror_r() with glib g_strerror() | expand

Commit Message

Michael Jeanson Feb. 2, 2017, 10:03 p.m. UTC
Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
 include/babeltrace/babeltrace-internal.h | 6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/include/babeltrace/babeltrace-internal.h b/include/babeltrace/babeltrace-internal.h
index 0e73cdb..6f8e200 100644
--- a/include/babeltrace/babeltrace-internal.h
+++ b/include/babeltrace/babeltrace-internal.h
@@ -161,8 +161,14 @@  extern int babeltrace_verbose, babeltrace_debug;
 
 /*
  * BT_HIDDEN: set the hidden attribute for internal functions
+ * On Windows, symbols are local unless explicitly exported,
+ * see https://gcc.gnu.org/wiki/Visibility
  */
+#if defined(_WIN32) || defined(__CYGWIN__)
+#define BT_HIDDEN
+#else
 #define BT_HIDDEN __attribute__((visibility("hidden")))
+#endif
 
 #define BT_CTF_MAJOR	1
 #define BT_CTF_MINOR	8