2020-12-16 20:26:16 +00:00
|
|
|
/*
|
|
|
|
* <assert.h> - make assertions
|
|
|
|
*
|
|
|
|
* This header is a part of the FENIX C Library and is free software.
|
|
|
|
* You can redistribute and/or modify it subject to the terms of the
|
|
|
|
* Clumsy Wolf Public License v4. For more details, see the file COPYING.
|
|
|
|
*
|
|
|
|
* The FENIX C Library is distributed WITH NO WARRANTY WHATSOEVER. See
|
|
|
|
* The CWPL for more details.
|
|
|
|
*/
|
|
|
|
|
2020-12-01 23:40:03 +00:00
|
|
|
#ifndef _ASSERT_H
|
|
|
|
#define _ASSERT_H
|
|
|
|
|
2020-12-21 00:43:46 +00:00
|
|
|
#include <stdlib.h>
|
2020-12-01 23:40:03 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#ifdef NDEBUG
|
|
|
|
#define assert(ignore) ((void) 0)
|
|
|
|
#else
|
2020-12-21 00:43:46 +00:00
|
|
|
#define assert(expression) (expression || (fprintf(stderr, "Assertion failed: %s: %d: %s", __FILE__, __LINE__, __func__) && abort()))
|
2020-12-01 23:40:03 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|