]> err.no Git - varnish/commitdiff
Add CHECK_OBJ_ORNULL() macro
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 23 Sep 2007 12:44:12 +0000 (12:44 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 23 Sep 2007 12:44:12 +0000 (12:44 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1981 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/include/miniobj.h

index cb727c585a2cf73c8e322d81f51f22a2a4d9705d..a620f8f95d74b214a319e8f2bda2790951c178a9 100644 (file)
                assert((ptr)->magic == type_magic);                     \
        } while (0)
 
+#define CHECK_OBJ_ORNULL(ptr, type_magic)                              \
+       do {                                                            \
+               if ((ptr) != NULL)                                      \
+                       assert((ptr)->magic == type_magic);             \
+       } while (0)
+
 #define CAST_OBJ(to, from, type_magic)                                 \
        do {                                                            \
                (to) = (from);                                          \