[Xfce4-commits] <libxfce4ui:nick/spawn-child-watch> Add some internal macros for debugging purposes.
Nick Schermer
noreply at xfce.org
Wed Nov 4 15:54:02 CET 2009
Updating branch refs/heads/nick/spawn-child-watch
to c5360220766505587f39bf7a861b19e764d64635 (commit)
from 191c7114ea38dcd2d7b063d00bd07c793a0a6290 (commit)
commit c5360220766505587f39bf7a861b19e764d64635
Author: Nick Schermer <nick at xfce.org>
Date: Wed Nov 4 15:46:30 2009 +0100
Add some internal macros for debugging purposes.
libxfce4ui/libxfce4ui-private.h | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/libxfce4ui/libxfce4ui-private.h b/libxfce4ui/libxfce4ui-private.h
index c9aa28c..efafdc3 100644
--- a/libxfce4ui/libxfce4ui-private.h
+++ b/libxfce4ui/libxfce4ui-private.h
@@ -29,6 +29,20 @@
G_BEGIN_DECLS
+/* support macros for debugging. you should only use them for internal
+ * functions, for public function use the normal g_* versions. */
+#ifndef NDEBUG
+#define _libxfce4ui_assert(expr) g_assert (expr)
+#define _libxfce4ui_assert_not_reached() g_assert_not_reached ()
+#define _libxfce4ui_return_if_fail(expr) g_return_if_fail (expr)
+#define _libxfce4ui_return_val_if_fail(expr, val) g_return_val_if_fail (expr, (val))
+#else
+#define _libxfce4ui_assert(expr) G_STMT_START{ (void)0; }G_STMT_END
+#define _libxfce4ui_assert_not_reached() G_STMT_START{ (void)0; }G_STMT_END
+#define _libxfce4ui_return_if_fail(expr) G_STMT_START{ (void)0; }G_STMT_END
+#define _libxfce4ui_return_val_if_fail(expr, val) G_STMT_START{ (void)0; }G_STMT_END
+#endif
+
/* support for canonical representations of strings */
#define I_(string) (g_intern_static_string ((string)))
More information about the Xfce4-commits
mailing list