[libdazzle] macros: check G_DISABLE_ASSERT



commit 4721e23d11858bbf6e34a38f7dfb4798c0f08ef8
Author: Christian Hergert <chergert redhat com>
Date:   Thu Nov 30 20:23:04 2017 -0800

    macros: check G_DISABLE_ASSERT
    
    Avoid the main-thread check when assertions are enabled.

 src/util/dzl-macros.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/util/dzl-macros.h b/src/util/dzl-macros.h
index e68b3ea..5a42f54 100644
--- a/src/util/dzl-macros.h
+++ b/src/util/dzl-macros.h
@@ -87,7 +87,8 @@ dzl_clear_source (guint *source_ptr)
 static inline void
 dzl_assert_is_main_thread (void)
 {
-#ifndef __linux__
+#ifndef G_DISABLE_ASSERT
+# ifndef __linux__
   static GThread *main;
   GThread *self = g_thread_self ();
 
@@ -103,6 +104,7 @@ dzl_assert_is_main_thread (void)
     }
 
   g_assert_not_reached ();
+# endif
 #endif
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]