]> granicus.if.org Git - libevent/commitdiff
Fix visibility issues under (mostly on win32)
authorAzat Khuzhin <a3at.mail@gmail.com>
Mon, 29 May 2017 12:04:50 +0000 (15:04 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Mon, 29 May 2017 19:01:33 +0000 (22:01 +0300)
Refs: #511
Fixes: 7182c2f561570cd9ceb704623ebe9ae3608c7b43 ("cmake: build SHARED and
STATIC libraries (like autoconf does)")

include/event2/visibility.h
log-internal.h
log.c

index af30905db4afcca380bb5699fdb274a47864dd6c..412a061c1c86c9d8b3bce658b333b9240a623084 100644 (file)
 # 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_ */
index b9d19f13a0882beb53fff07f9777457952ce1127..fb53df416abe691dfa0738b52086c974f49eb1ae 100644 (file)
@@ -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 ed955575eae8f1e4d58febbc2c337ac4af4478c1..a9debb864e4f7fe52a6984580958bd2d51b3144a 100644 (file)
--- 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