From 25d9f44237780ae59483a889d5d37351df480fe9 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 26 Jan 2017 15:09:22 -0500 Subject: [PATCH] Port: win32 DLLs don't support hidden symbols MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- 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 8ae6535d0..90849ed30 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.34.1