-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassert.H
executable file
·56 lines (38 loc) · 1.38 KB
/
assert.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
File: assert.H
Author: R. Bettati
Department of Computer Science
Texas A&M University
Date : 05/01/23
Header file for the "assert" macro.
*/
#ifndef __assert_H__
#define __assert_H__
/*--------------------------------------------------------------------------*/
/* INCLUDES */
/*--------------------------------------------------------------------------*/
#include "utils.H"
/*--------------------------------------------------------------------------*/
/* DATA STRUCTURES */
/*--------------------------------------------------------------------------*/
/* -- (none) -- */
/*--------------------------------------------------------------------------*/
/* CONSTANTS */
/*--------------------------------------------------------------------------*/
/* -- (none) -- */
/*--------------------------------------------------------------------------*/
/* "ASSERT" MACRO */
/*--------------------------------------------------------------------------*/
/* NOTE: The "assert" macros can be turned off by giving the -DNDEBUG
argument when compiling. */
#ifdef assert
# undef assert
#endif
void _assert ( const char* _file, const int _line, const char* _message );
#ifdef NDEBUG
# define assert( m ) ( ( void ) 0 )
#else
# define assert( m ) \
if ( !(m) ) _assert( __FILE__, __LINE__, #m );
#endif
#endif