diff dlib/dlib.h @ 786:17d77a1950d8

Added: dReturn_if() and dReturn_val_if() macros to Dlib.
author Jorge Arellano Cid <jcid@dillo.org>
date Sat, 17 Jan 2009 17:15:31 -0300
parents 7a76f872ce73
children 64e078b7a711
line wrap: on
line diff
--- a/dlib/dlib.h	Sat Jan 17 15:31:10 2009 -0300
+++ b/dlib/dlib.h	Sat Jan 17 17:15:31 2009 -0300
@@ -55,6 +55,14 @@
  */
 #define D_STMT_START      do
 #define D_STMT_END        while (0)
+#define dReturn_if(expr)               \
+   D_STMT_START{                       \
+      if (expr) { return; };           \
+   }D_STMT_END
+#define dReturn_val_if(expr)           \
+   D_STMT_START{                       \
+      if (expr) { return val; };       \
+   }D_STMT_END
 #define dReturn_if_fail(expr)          \
    D_STMT_START{                       \
       if (!(expr)) { return; };        \