log/win32: fix exporting extern variable

==> win:   C:\vagrant\log.c(73): error C2370: 'event_debug_logging_mask_' : redefinition; different storage class [C:\vagrant\.cmake-vagrant\event_core_shared.vcxproj]
This commit is contained in:
Azat Khuzhin 2017-03-14 00:33:26 +03:00
parent a9c2116fac
commit 92cf234b0c
3 changed files with 14 additions and 3 deletions

View File

@ -34,6 +34,7 @@
defined(event_core_shared_EXPORTS) || \
defined(event_pthreads_shared_EXPORTS) || \
defined(event_openssl_shared_EXPORTS)
# if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
# define EVENT2_EXPORT_SYMBOL __global
# elif defined __GNUC__
@ -43,12 +44,21 @@
# else
# define EVENT2_EXPORT_SYMBOL /* unknown compiler */
# endif
#else
#else /* event_*_EXPORTS */
# if defined(_MSC_VER)
# define EVENT2_EXPORT_SYMBOL extern __declspec(dllimport)
# else
# define EVENT2_EXPORT_SYMBOL
# endif
#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,8 @@ extern "C" {
#endif
#ifdef EVENT_DEBUG_LOGGING_ENABLED
EVENT2_EXPORT_SYMBOL
extern ev_uint32_t event_debug_logging_mask_;
EVENT2_EXPORT_SYMBOL_DECL
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)

1
log.c
View File

@ -69,6 +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;
#endif /* EVENT_DEBUG_LOGGING_ENABLED */