Mailing List Archive

r2525 - trunk/varnish-cache/bin/varnishd
Author: des
Date: 2008-02-21 21:49:11 +0100 (Thu, 21 Feb 2008)
New Revision: 2525

Modified:
trunk/varnish-cache/bin/varnishd/cache.h
Log:
Add SPAZ() and SPAN() macros which combine AZ() and AN() with spassert().


Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2008-02-20 14:01:35 UTC (rev 2524)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2008-02-21 20:49:11 UTC (rev 2525)
@@ -665,6 +665,8 @@

#ifdef WITHOUT_ASSERTS
#define spassert(cond) ((void)(cond))
+#define SPAZ(val) ((void)(val) == 0)
+#define SPAN(val) ((void)(val) != 0)
#else
void panic(const char *, int, const char *,
const struct sess *, const char *, ...);
@@ -675,4 +677,6 @@
panic(__FILE__, __LINE__, __func__, sp, \
"assertion failed: %s\n", #cond); \
} while (0)
+#define SPAZ(val) spassert((val) == 0)
+#define SPAN(val) spassert((val) != 0)
#endif