Branch: Tag:

2004-04-21

2004-04-21 16:02:49 by Martin Stjernholm <mast@lysator.liu.se>

Added an assert macro that is activated with the DEBUG define.

Rev: server/etc/include/roxen.h:1.28

1:   // -*- pike -*-   // - // $Id: roxen.h,v 1.27 2003/11/25 17:02:04 anders Exp $ + // $Id: roxen.h,v 1.28 2004/04/21 16:02:49 mast Exp $      #ifndef _ROXEN_H_   
36: Inside #if defined(DEBUG)
     #ifdef DEBUG   #define DO_IF_DEBUG(X...) X + #define ASSERT_IF_DEBUG(TEST, ARGS...) do { \ +  if (!(TEST)) error ("Assertion failed: " #TEST, ARGS); \ +  } while (0)   #else   #define DO_IF_DEBUG(X...) -  + #define ASSERT_IF_DEBUG(TEST, ARGS...) do {} while (0)   #endif      #ifdef DEBUG_CACHEABLE