Skip to content

Commit

Permalink
Fix visibility issues under (mostly on win32)
Browse files Browse the repository at this point in the history
Refs: libevent#511
Fixes: 7182c2f ("cmake: build SHARED and
STATIC libraries (like autoconf does)")
  • Loading branch information
azat committed May 29, 2017
1 parent 2773a5e commit ce3af53
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
14 changes: 2 additions & 12 deletions include/event2/visibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */
3 changes: 1 addition & 2 deletions log-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ce3af53

Please sign in to comment.