]> granicus.if.org Git - libevent/commitdiff
event_debug_created_threadable_ctx_: fix compilation without debug mode
authorAzat Khuzhin <a3at.mail@gmail.com>
Tue, 29 Sep 2015 17:36:39 +0000 (20:36 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Tue, 29 Sep 2015 17:42:45 +0000 (20:42 +0300)
The following command failed before:
$ ./configure --disable-debug-mode

Fixes: dcfb19a27b7760299bc9e7291c9abd88c59fd91a ("Debug mode option to error on
evthread init AFTER other event calls.")

event.c

diff --git a/event.c b/event.c
index a932c3bbbc8c65c86fd8884cf77e03a839ebfdb8..2e6b53502f7ded380f4e44c585788653f7319ffb 100644 (file)
--- a/event.c
+++ b/event.c
@@ -201,6 +201,7 @@ eq_debug_entry(const struct event_debug_entry *a,
 int event_debug_mode_on_ = 0;
 
 
+#if !defined(EVENT__DISABLE_THREAD_SUPPORT) && !defined(EVENT__DISABLE_DEBUG_MODE)
 /**
  * @brief debug mode variable which is set for any function/structure that needs
  *        to be shared across threads (if thread support is enabled).
@@ -212,6 +213,7 @@ int event_debug_mode_on_ = 0;
  *        See: "Locks and threading" in the documentation.
  */
 int event_debug_created_threadable_ctx_ = 0;
+#endif
 
 /* Set if it's too late to enable event_debug_mode. */
 static int event_debug_mode_too_late = 0;
@@ -669,9 +671,11 @@ event_base_new_with_config(const struct event_config *cfg)
 
        /* prepare for threading */
 
-#ifndef EVENT__DISABLE_THREAD_SUPPORT
+#if !defined(EVENT__DISABLE_THREAD_SUPPORT) && !defined(EVENT__DISABLE_DEBUG_MODE)
        event_debug_created_threadable_ctx_ = 1;
+#endif
 
+#ifndef EVENT__DISABLE_DEBUG_MODE
        if (EVTHREAD_LOCKING_ENABLED() &&
            (!cfg || !(cfg->flags & EVENT_BASE_FLAG_NOLOCK))) {
                int r;