Fixed assert() macro, fixed header

svn path=/trunk/; revision=2957
This commit is contained in:
KJK::Hyperion 2002-05-17 01:42:41 +00:00
parent 9523648137
commit 34a6708f44

View file

@ -1,4 +1,4 @@
/* $Id: assert.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $ /* $Id: assert.h,v 1.3 2002/05/17 01:42:41 hyperion Exp $
*/ */
/* /*
* assert.h * assert.h
@ -25,35 +25,28 @@
#ifndef __ASSERT_H_INCLUDED__ #ifndef __ASSERT_H_INCLUDED__
#define __ASSERT_H_INCLUDED__ #define __ASSERT_H_INCLUDED__
/* types */ /* INCLUDES */
/* constants */ /* OBJECTS */
/* prototypes */ /* TYPES */
/* macros */ /* CONSTANTS */
/* PROTOTYPES */
/* MACROS */
#ifdef NDEBUG #ifdef NDEBUG
#define assert(ignore) ((void) 0) #define assert(IGNORE) ((void) 0)
#else /* !NDEBUG */ #else /* !NDEBUG */
#define assert(expression) \
#ifdef __PSXDLL__
/* headers for internal usage by psxdll.dll and ReactOS */
#include <psxdll/stdio.h>
#include <psxdll/stdlib.h>
#else /* ! __PSXDLL__ */
/* standard POSIX headers */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#endif #define assert(EXPRESSION) \
if(!(EXPRESSION)) \
if(!(expression)) \
{ \ { \
fputs("__FILE__, line __LINE__: assertion \"expression\" failed\n", stderr); \ fputs("__FILE__, line __LINE__: assertion \"EXPRESSION\" failed\n", stderr); \
abort(); \ abort(); \
} }