From 3588a1599fa5bdf4467282a560f936e34ca7e271 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 9 Feb 1987 15:26:16 +0000 Subject: [PATCH] Initial revision --- include/_tail_cc/assert.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 include/_tail_cc/assert.h diff --git a/include/_tail_cc/assert.h b/include/_tail_cc/assert.h new file mode 100644 index 000000000..5cd6c435b --- /dev/null +++ b/include/_tail_cc/assert.h @@ -0,0 +1,11 @@ +/* $Header$ */ +/* A S S E R T I O N M A C R O D E F I N I T I O N */ + +#ifndef NDEBUG +/* Note: this macro uses parameter substitution inside strings */ +#define assert(exp) (exp || (fprintf(stderr,"Assertion \"%s\" failed: file %s, line %d\n", "exp", __FILE__, __LINE__), exit(1))) +#define _assert(exp) (exp || (fprintf(stderr,"Assertion \"%s\" failed: file %s, line %d\n", "exp", __FILE__, __LINE__), exit(1))) +#else +#define assert(exp) (1) +#define _assert(exp) (1) +#endif NDEBUG