File: EmAssert.h

package info (click to toggle)
pose 3.5-7
  • links: PTS
  • area: contrib
  • in suites: sarge
  • size: 14,136 kB
  • ctags: 29,490
  • sloc: cpp: 93,990; ansic: 62,838; sh: 27,519; perl: 1,891; python: 1,242; makefile: 652
file content (45 lines) | stat: -rw-r--r-- 1,160 bytes parent folder | download | duplicates (3)
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
/* -*- mode: C++; tab-width: 4 -*- */
/* ===================================================================== *\
	Copyright (c) 2001 Palm, Inc. or its subsidiaries.
	All rights reserved.

	This file is part of the Palm OS Emulator.

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.
\* ===================================================================== */

#ifndef EmAssert_h
#define EmAssert_h

#ifdef __cplusplus
extern "C"
#endif
void MyAssertFailed (
	const char* assertion,
	const char* file,
	unsigned int line);

// Use EmAssert to assert only in debug mode.
// Use EmASSERT to assert even in release mode.
// The latter should be used only temporarily to
// find bugs that occur only in release mode.

#define EmASSERT(expr)					\
  ((void) ((expr) ? 0 :					\
	   (MyAssertFailed (#expr,			\
			   __FILE__, __LINE__), 0)))

#ifdef NDEBUG

	#define EmAssert(expr) ((void) 0)

#else

	#define EmAssert(expr)	EmASSERT (expr)

#endif

#endif	// EmAssert.h