From: des Date: Thu, 21 Feb 2008 20:49:11 +0000 (+0000) Subject: Add SPAZ() and SPAN() macros which combine AZ() and AN() with spassert(). X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba5ad2093ed6e6f3aad562bdc2d5376cda54e034;p=varnish Add SPAZ() and SPAN() macros which combine AZ() and AN() with spassert(). git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2525 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index 5d1396ae..80f40679 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -665,6 +665,8 @@ Tlen(const txt t) #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 @@ void panic(const char *, int, const char *, 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