Line | |
---|
1 | /* Copyright (c) 1985 Ceriel J.H. Jacobs */
|
---|
2 |
|
---|
3 | /* $Header: /cvsup/minix/src/commands/yap/assert.h,v 1.1.1.1 2005/04/21 14:55:38 beng Exp $ */
|
---|
4 |
|
---|
5 | /* Assertion macro */
|
---|
6 |
|
---|
7 | # ifndef _ASSERT_
|
---|
8 | # define PUBLIC extern
|
---|
9 | # else
|
---|
10 | # define PUBLIC
|
---|
11 | # endif
|
---|
12 |
|
---|
13 | #if DO_ASSERT
|
---|
14 | #define assert(x) if(!(x)) badassertion("x",__FILE__,__LINE__)
|
---|
15 | VOID badassertion();
|
---|
16 | /*
|
---|
17 | * void badassertion(ass,fn,lineno)
|
---|
18 | * char *ass, The assertion in string form,
|
---|
19 | * *fn; The filename in which the assertion failed,
|
---|
20 | * int lineno; The line number of the assertion.
|
---|
21 | *
|
---|
22 | * Reports the assertion on standard output and then aborts with a core dump.
|
---|
23 | */
|
---|
24 | #else
|
---|
25 | #define assert(x) /* nothing */
|
---|
26 | #endif
|
---|
27 |
|
---|
28 | # undef PUBLIC
|
---|
Note:
See
TracBrowser
for help on using the repository browser.