From 8f10e250bd43715dd901c64bdee2ecdf2abdfbe6 Mon Sep 17 00:00:00 2001 From: des Date: Thu, 15 Nov 2007 15:07:15 +0000 Subject: [PATCH] Add a VALID_OBJ() predicate macro. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2253 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/include/miniobj.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/varnish-cache/include/miniobj.h b/varnish-cache/include/miniobj.h index a620f8f9..2565f102 100644 --- a/varnish-cache/include/miniobj.h +++ b/varnish-cache/include/miniobj.h @@ -12,6 +12,9 @@ free(to); \ } while (0) +#define VALID_OBJ(ptr, type_magic) \ + ((ptr) != NULL && (ptr)->magic == (type_magic)) + #define CHECK_OBJ(ptr, type_magic) \ do { \ assert((ptr)->magic == type_magic); \ -- 2.39.5