source: trunk/minix/servers/inet/generic/assert.h@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 637 bytes
Line 
1/*
2assert.h
3
4Copyright 1995 Philip Homburg
5*/
6#ifndef INET_ASSERT_H
7#define INET_ASSERT_H
8
9#if !NDEBUG
10
11void bad_assertion(char *file, int line, char *what) _NORETURN;
12void 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.