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 | * | |
7 | * @(#)assert.h 4.3 (Berkeley) %G% | |
8 | */ | |
2b4d10ef | 9 | |
39feb7f4 KB |
10 | #ifdef NDEBUG |
11 | #define assert | |
12 | #define _assert | |
13 | #else | |
14 | #define assert(expression) { \ | |
15 | if (!(expression)) { \ | |
16 | (void)fprintf(stderr, \ | |
17 | "assertion \"%s\" failed: file \"%s\", line %d\n", \ | |
18 | "expression", __FILE__, __LINE__); \ | |
19 | exit(2); \ | |
20 | } \ | |
21 | } | |
22 | #define _assert(expression) assert(expression) | |
23 | #endif |