Only use G_LIKELY in g_assert() and g_return_[val]_if_fail() if it is
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 26 Nov 2002 19:48:52 +0000 (19:48 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 26 Nov 2002 19:48:52 +0000 (19:48 +0000)
* glib/gmessages.h: Only use G_LIKELY in g_assert() and
g_return_[val]_if_fail() if it is actually doing something.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gmessages.h

index 1505da8..b9deb2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-11-26  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h: Only use G_LIKELY in g_assert() and 
+       g_return_[val]_if_fail() if it is actually doing something.
+
 2002-11-26  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/grand.c, gthread/gthread-impl.c, tests/rand-test.c: 
index 1505da8..b9deb2b 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-26  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h: Only use G_LIKELY in g_assert() and 
+       g_return_[val]_if_fail() if it is actually doing something.
+
 2002-11-26  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/grand.c, gthread/gthread-impl.c, tests/rand-test.c: 
index 1505da8..b9deb2b 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-26  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h: Only use G_LIKELY in g_assert() and 
+       g_return_[val]_if_fail() if it is actually doing something.
+
 2002-11-26  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/grand.c, gthread/gthread-impl.c, tests/rand-test.c: 
index 1505da8..b9deb2b 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-26  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h: Only use G_LIKELY in g_assert() and 
+       g_return_[val]_if_fail() if it is actually doing something.
+
 2002-11-26  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/grand.c, gthread/gthread-impl.c, tests/rand-test.c: 
index 1505da8..b9deb2b 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-26  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h: Only use G_LIKELY in g_assert() and 
+       g_return_[val]_if_fail() if it is actually doing something.
+
 2002-11-26  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/grand.c, gthread/gthread-impl.c, tests/rand-test.c: 
index 1505da8..b9deb2b 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-26  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h: Only use G_LIKELY in g_assert() and 
+       g_return_[val]_if_fail() if it is actually doing something.
+
 2002-11-26  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/grand.c, gthread/gthread-impl.c, tests/rand-test.c: 
index 1505da8..b9deb2b 100644 (file)
@@ -1,3 +1,8 @@
+2002-11-26  Matthias Clasen  <maclas@gmx.de>
+
+       * glib/gmessages.h: Only use G_LIKELY in g_assert() and 
+       g_return_[val]_if_fail() if it is actually doing something.
+
 2002-11-26  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * glib/grand.c, gthread/gthread-impl.c, tests/rand-test.c: 
index 3a4a8dd..da3f15b 100644 (file)
@@ -198,7 +198,7 @@ GPrintFunc      g_set_printerr_handler  (GPrintFunc      func);
 
 #else /* !G_DISABLE_ASSERT */
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && (__GNUC__ > 2)  && defined(__OPTIMIZE__)
 
 #define g_assert(expr)                 G_STMT_START{           \
      if (!G_LIKELY (expr))                                     \
@@ -250,7 +250,7 @@ GPrintFunc      g_set_printerr_handler  (GPrintFunc      func);
 
 #else /* !G_DISABLE_CHECKS */
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
 
 #define g_return_if_fail(expr)         G_STMT_START{                   \
      if (!G_LIKELY (expr))                                             \