pspsdk-1.0+beta2
assert.h
Go to the documentation of this file.
1 /*
2  * PSP Software Development Kit - http://www.pspdev.org
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5  *
6  * assert.h
7  *
8  * Copyright (c) 2002-2004 PS2DEV
9  * Copyright (c) 2005 Marcus R. Brown <mrbrown@ocgnet.org>
10  * Copyright (c) 2005 James Forshaw <tyranid@gmail.com>
11  * Copyright (c) 2005 John Kelley <ps2dev@kelley.ca>
12  *
13  * $Id: assert.h 1095 2005-09-27 21:02:16Z jim $
14  */
15 #ifndef __ASSERT_H__
16 #define __ASSERT_H__
17 
18 #include <pspkernel.h>
19 #include <stdio.h>
20 
21 #ifdef NDEBUG
22 #define assert(cond)
23 #else
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27  int __assert_fail (const char *assertion, const char *file, unsigned int line) __attribute__((noreturn));
28 #ifdef __cplusplus
29 }
30 #endif
31 #define assert(cond) (void)((cond)?0:__assert_fail(#cond, __FILE__, __LINE__))
32 #endif
33 
34 #endif