summaryrefslogtreecommitdiff
path: root/include/assert.h
blob: aef6cdf08c8ad172a5bbc7cd693b8cd504526ad4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef	__ASSERT_H
#define	__ASSERT_H
#include <features.h>

/* If NDEBUG is defined, do nothing.
   If not, and EXPRESSION is zero, print an error message and abort.  */

#ifdef	NDEBUG

#define	assert(expr)		((void) 0)

#else /* Not NDEBUG.  */

extern void __assert __P((const char *, const char *, int));

#define	assert(expr)							      \
  ((void) ((expr) ||							      \
	   (__assert (__STRING(expr),				      \
			   __FILE__, __LINE__), 0)))

#endif /* NDEBUG.  */

#endif /* __ASSERT_H */