| 2875 |
dpurdie |
1 |
#pragma force_top_level
|
|
|
2 |
|
|
|
3 |
/* assert.h: ANSI 'C' (X3J11 Oct 88) library header section 4.2 */
|
|
|
4 |
/* Copyright (C) Codemist Ltd., 1988-1993 */
|
|
|
5 |
/* Copyright (C) Advanced Risc Machines Ltd., 1991-1993 */
|
|
|
6 |
/* version 0.04 */
|
|
|
7 |
|
|
|
8 |
/*
|
|
|
9 |
* RCS $Revision: 1.4 $
|
|
|
10 |
* Checkin $Date: 1997/09/02 11:11:30 $
|
|
|
11 |
* Revising $Author: achapman $
|
|
|
12 |
*/
|
|
|
13 |
|
|
|
14 |
/*
|
|
|
15 |
* The assert macro puts diagnostics into programs. When it is executed,
|
|
|
16 |
* if its argument expression is false, it writes information about the
|
|
|
17 |
* call that failed (including the text of the argument, the name of the
|
|
|
18 |
* source file, and the source line number - the latter are respectively
|
|
|
19 |
* the values of the preprocessing macros __FILE__ and __LINE__) on the
|
|
|
20 |
* standard error stream. It then calls the abort function.
|
|
|
21 |
* If its argument expression is true, the assert macro returns no value.
|
|
|
22 |
*/
|
|
|
23 |
|
|
|
24 |
/*
|
|
|
25 |
* Note that <assert.h> may be included more that once in a program with
|
|
|
26 |
* different setting of NDEBUG. Hence the slightly unusual first-time
|
|
|
27 |
* only flag.
|
|
|
28 |
*/
|
|
|
29 |
|
|
|
30 |
#ifndef __assert_h
|
|
|
31 |
# define __assert_h
|
|
|
32 |
# ifdef __cplusplus
|
|
|
33 |
extern "C" void __assert(const char *, const char *, int);
|
|
|
34 |
# else
|
|
|
35 |
extern void __assert(const char *, const char *, int);
|
|
|
36 |
# endif
|
|
|
37 |
#else
|
|
|
38 |
# undef assert
|
|
|
39 |
#endif
|
|
|
40 |
|
|
|
41 |
#ifdef NDEBUG
|
|
|
42 |
# define assert(ignore) ((void)0)
|
|
|
43 |
#else
|
|
|
44 |
# ifdef __STDC__
|
|
|
45 |
# define assert(e) ((e) ? (void)0 : __assert(#e, __FILE__, __LINE__))
|
|
|
46 |
# else
|
|
|
47 |
# define assert(e) ((e) ? (void)0 : __assert("e", __FILE__, __LINE__))
|
|
|
48 |
# endif
|
|
|
49 |
#endif
|
|
|
50 |
|
|
|
51 |
/* end of assert.h */
|