Add a G_UNLIKELY to g_assert ().
authorZoltan Varga <vargaz@gmail.com>
Tue, 22 Feb 2011 00:04:58 +0000 (01:04 +0100)
committerZoltan Varga <vargaz@gmail.com>
Tue, 22 Feb 2011 00:04:58 +0000 (01:04 +0100)
eglib/src/glib.h

index 3ea7102a52ec545164b4901847ec0d0a114924c4..3cda065a063dcdef600879aa6010d0840a415946 100644 (file)
@@ -231,9 +231,6 @@ guint    g_int_hash     (gconstpointer v1);
 gboolean g_str_equal    (gconstpointer v1, gconstpointer v2);
 guint    g_str_hash     (gconstpointer v1);
 
-#define  g_assert(x)     G_STMT_START { if (!(x)) g_assertion_message ("* Assertion at %s:%d, condition `%s' not met\n", __FILE__, __LINE__, #x);  } G_STMT_END
-#define  g_assert_not_reached() G_STMT_START { g_assertion_message ("* Assertion: should not be reached at %s:%d\n", __FILE__, __LINE__); } G_STMT_END
-
 /*
  * Errors
  */
@@ -649,6 +646,9 @@ gint           g_unichar_xdigit_value (gunichar c);
 #define G_UNLIKELY(x) (x)
 #endif
 
+#define  g_assert(x)     G_STMT_START { if (G_UNLIKELY (!(x))) g_assertion_message ("* Assertion at %s:%d, condition `%s' not met\n", __FILE__, __LINE__, #x);  } G_STMT_END
+#define  g_assert_not_reached() G_STMT_START { g_assertion_message ("* Assertion: should not be reached at %s:%d\n", __FILE__, __LINE__); } G_STMT_END
+
 /*
  * Unicode conversion
  */