From: Azat Khuzhin Date: Mon, 29 May 2017 12:04:50 +0000 (+0300) Subject: Fix visibility issues under (mostly on win32) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce3af533f1b11c4b302d404483f28660eb5d7190;p=libevent Fix visibility issues under (mostly on win32) Refs: #511 Fixes: 7182c2f561570cd9ceb704623ebe9ae3608c7b43 ("cmake: build SHARED and STATIC libraries (like autoconf does)") --- diff --git a/include/event2/visibility.h b/include/event2/visibility.h index af30905d..412a061c 100644 --- a/include/event2/visibility.h +++ b/include/event2/visibility.h @@ -40,25 +40,15 @@ # elif defined __GNUC__ # define EVENT2_EXPORT_SYMBOL __attribute__ ((visibility("default"))) # elif defined(_MSC_VER) -# define EVENT2_EXPORT_SYMBOL extern __declspec(dllexport) +# define EVENT2_EXPORT_SYMBOL __declspec(dllexport) # else # define EVENT2_EXPORT_SYMBOL /* unknown compiler */ # endif #else /* event_*_EXPORTS */ -# if defined(_MSC_VER) -# define EVENT2_EXPORT_SYMBOL extern __declspec(dllimport) -# else -# define EVENT2_EXPORT_SYMBOL -# endif +# define EVENT2_EXPORT_SYMBOL #endif /* event_*_EXPORTS */ -#if defined(_MSC_VER) -# define EVENT2_EXPORT_SYMBOL_DECL __declspec(dllimport) -#else -# define EVENT2_EXPORT_SYMBOL_DECL extern -#endif - #endif /* EVENT2_VISIBILITY_H_INCLUDED_ */ diff --git a/log-internal.h b/log-internal.h index b9d19f13..fb53df41 100644 --- a/log-internal.h +++ b/log-internal.h @@ -48,8 +48,7 @@ extern "C" { #endif #ifdef EVENT_DEBUG_LOGGING_ENABLED -EVENT2_EXPORT_SYMBOL_DECL -ev_uint32_t event_debug_logging_mask_; +EVENT2_EXPORT_SYMBOL extern ev_uint32_t event_debug_logging_mask_; #define event_debug_get_logging_mask_() (event_debug_logging_mask_) #else #define event_debug_get_logging_mask_() (0) diff --git a/log.c b/log.c index ed955575..a9debb86 100644 --- a/log.c +++ b/log.c @@ -69,8 +69,7 @@ static event_fatal_cb fatal_fn = NULL; #define DEFAULT_MASK 0 #endif -EVENT2_EXPORT_SYMBOL -ev_uint32_t event_debug_logging_mask_ = DEFAULT_MASK; +EVENT2_EXPORT_SYMBOL ev_uint32_t event_debug_logging_mask_ = DEFAULT_MASK; #endif /* EVENT_DEBUG_LOGGING_ENABLED */ void