From: Azat Khuzhin Date: Sun, 28 Oct 2018 16:30:34 +0000 (+0300) Subject: Introduce EVENT_VISIBILITY_WANT_DLLIMPORT X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9cba915ee8f1cfc78d846eeaf00cc209338b272b;p=libevent Introduce EVENT_VISIBILITY_WANT_DLLIMPORT And use it in places where event_debug() should be called (since it requires access to "event_debug_logging_mask_" and in win32 it is tricky). One of this places that is covered by this patch is the test for event_debug(). --- diff --git a/include/event2/visibility.h b/include/event2/visibility.h index 779eb68d..006bbf06 100644 --- a/include/event2/visibility.h +++ b/include/event2/visibility.h @@ -55,7 +55,8 @@ #if defined(_MSC_VER) # if defined(event_core_shared_EXPORTS) /** from core export */ # define EVENT2_CORE_EXPORT_SYMBOL __declspec(dllexport) -# elif defined(event_extra_shared_EXPORTS) /** from extra import */ +# elif defined(event_extra_shared_EXPORTS) || /** from extra import */ \ + defined(EVENT_VISIBILITY_WANT_DLLIMPORT) # define EVENT2_CORE_EXPORT_SYMBOL __declspec(dllimport) # endif #endif /* _MSC_VER */ diff --git a/test/regress_util.c b/test/regress_util.c index 320047fa..721537cc 100644 --- a/test/regress_util.c +++ b/test/regress_util.c @@ -23,6 +23,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +/** For event_debug() usage/coverage */ +#define EVENT_VISIBILITY_WANT_DLLIMPORT + #include "../util-internal.h" #ifdef _WIN32