File: Assert.h

package info (click to toggle)
proda 1.0-12
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 584 kB
  • sloc: cpp: 8,549; xml: 163; makefile: 109; sh: 12
file content (18 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//////////////////////////////////////////////////////////////////////
// Assert.h
//
// Extension of C assert() that allows for error messages.
//////////////////////////////////////////////////////////////////////

#ifndef ASSERT_H
#define ASSERT_H

int _ASSERT_FAILED (const char *filename, int line_number, const char *error_msg);

#ifdef NDEBUG
#define ASSERT(test,error_msg)
#else
#define ASSERT(test,error_msg) (test ? 0 : _ASSERT_FAILED(__FILE__, __LINE__, error_msg))
#endif
  
#endif