Line | |
---|
1 | /*
|
---|
2 | assert.h
|
---|
3 |
|
---|
4 | Copyright 1995 Philip Homburg
|
---|
5 | */
|
---|
6 | #ifndef INET_ASSERT_H
|
---|
7 | #define INET_ASSERT_H
|
---|
8 |
|
---|
9 | #if !NDEBUG
|
---|
10 |
|
---|
11 | void bad_assertion(char *file, int line, char *what) _NORETURN;
|
---|
12 | void bad_compare(char *file, int line, int lhs, char *what, int rhs) _NORETURN;
|
---|
13 |
|
---|
14 | #define assert(x) ((void)(!(x) ? bad_assertion(this_file, __LINE__, \
|
---|
15 | #x),0 : 0))
|
---|
16 | #define compare(a,t,b) (!((a) t (b)) ? bad_compare(this_file, __LINE__, \
|
---|
17 | (a), #a " " #t " " #b, (b)) : (void) 0)
|
---|
18 |
|
---|
19 | #else /* NDEBUG */
|
---|
20 |
|
---|
21 | #define assert(x) 0
|
---|
22 | #define compare(a,t,b) 0
|
---|
23 |
|
---|
24 | #endif /* NDEBUG */
|
---|
25 |
|
---|
26 | #endif /* INET_ASSERT_H */
|
---|
27 |
|
---|
28 |
|
---|
29 | /*
|
---|
30 | * $PchId: assert.h,v 1.8 2002/03/18 21:50:32 philip Exp $
|
---|
31 | */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.