/* NAME:
 *	assert.h - enforce assertions
 *
 * DESCRIPTION:
 *	If syslog.h has been included before us, we syslog() as well
 *	as printing to stderr.  The macro ASSERT() defaults to
 *	abort()ing the process, while assert() simply exit()s
 * 
 * RCSid:
 *	$Id: assert.h,v 1.1 1997/01/28 07:06:36 sjg Exp $
 */
# ifndef NDEBUG
#ifdef LOG_NOTICE
# define _assert(ex,act)    {if (!(ex)){syslog(LOG_ERR, "Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);(void)fprintf(stderr,"Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);act;}}
#else
# define _assert(ex,act)    {if (!(ex)){(void)fprintf(stderr,"Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);act;}}
#endif
# define assert(ex)     _assert(ex,exit(1))
/* on some systems we need to make this kill(getpid(), 6) */
#ifndef ABORT
# define ABORT abort()
#endif
# define ASSERT(ex)     _assert(ex,ABORT)
# else
/* just eat them */
# define _assert(ex)
# define assert(ex)
# define ASSERT(ex)
# endif
