From c77244152327e2223e55144a463094790d835933 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 5 Aug 2012 17:22:29 -0700 Subject: assert_(...) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This new macro expands to ‘assert(...),’ (with a trailing comma) under debugging builds; the empty string otherwise. It allows for the removal of some #ifdef DEBUGGINGs, which could not be avoided otherwise. --- op.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'op.h') diff --git a/op.h b/op.h index 3f1e250f7a..c4147cee2a 100644 --- a/op.h +++ b/op.h @@ -748,12 +748,8 @@ struct opslab { # define OPSLOT_HEADER STRUCT_OFFSET(OPSLOT, opslot_op) # define OPSLOT_HEADER_P (OPSLOT_HEADER/sizeof(I32 *)) -# ifdef DEBUGGING -# define OpSLOT(o) (assert(o->op_slabbed), \ +# define OpSLOT(o) (assert_(o->op_slabbed) \ (OPSLOT *)(((char *)o)-OPSLOT_HEADER)) -# else -# define OpSLOT(o) ((OPSLOT *)(((char *)o)-OPSLOT_HEADER)) -# endif # define OpSLAB(o) OpSLOT(o)->opslot_slab # define OpslabREFCNT_dec(slab) \ (((slab)->opslab_refcnt == 1) \ -- cgit v1.2.1