[lttng-dev] [PATCH lttng-tools 2/2] Port: win32 DLLs don't support hidden symbols
Michael Jeanson
mjeanson at efficios.com
Thu Jan 26 20:09:22 UTC 2017
Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
src/common/macros.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/common/macros.h b/src/common/macros.h
index 8ae6535..90849ed 100644
--- a/src/common/macros.h
+++ b/src/common/macros.h
@@ -74,7 +74,14 @@ void *zmalloc(size_t len)
#define LTTNG_PACKED __attribute__((__packed__))
#endif
-#ifndef LTTNG_HIDDEN
+/*
+ * LTTNG_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 LTTNG_HIDDEN
+#else
#define LTTNG_HIDDEN __attribute__((visibility("hidden")))
#endif
--
2.7.4
More information about the lttng-dev
mailing list