Fix visibility issues under (mostly on win32)

Refs: #511
Fixes: 7182c2f561570cd9ceb704623ebe9ae3608c7b43 ("cmake: build SHARED and
STATIC libraries (like autoconf does)")

(cherry picked from commit ce3af533f1b11c4b302d404483f28660eb5d7190)
This commit is contained in:
Azat Khuzhin 2017-05-29 15:04:50 +03:00 committed by Azat Khuzhin
parent 6f74954017
commit a1f28e2f9c
No known key found for this signature in database
GPG Key ID: B86086848EF8686D
3 changed files with 4 additions and 16 deletions

View File

@ -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_ */

View 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)

3
log.c
View File

@ -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