Commit | Line | Data |
---|---|---|
39feb7f4 KB |
1 | /*- |
2 | * Copyright (c) 1990 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * %sccs.include.redist.c% | |
6 | * | |
d2b7358e | 7 | * @(#)assert.h 4.4 (Berkeley) %G% |
39feb7f4 | 8 | */ |
2b4d10ef | 9 | |
d2b7358e KB |
10 | #ifndef _ASSERT_H_ |
11 | #define _ASSERT_H_ | |
12 | ||
39feb7f4 KB |
13 | #ifdef NDEBUG |
14 | #define assert | |
15 | #define _assert | |
16 | #else | |
17 | #define assert(expression) { \ | |
18 | if (!(expression)) { \ | |
19 | (void)fprintf(stderr, \ | |
20 | "assertion \"%s\" failed: file \"%s\", line %d\n", \ | |
21 | "expression", __FILE__, __LINE__); \ | |
22 | exit(2); \ | |
23 | } \ | |
24 | } | |
25 | #define _assert(expression) assert(expression) | |
26 | #endif | |
d2b7358e KB |
27 | |
28 | #endif /* !_ASSERT_H_ */ |