00001 /*--------------------------------------------------------------------------------- 00002 00003 sassert.h -- definitons for DS assertions 00004 00005 Copyright (C) 2007 00006 Dave Murphy (WinterMute) 00007 Jason Rogers (Dovoto) 00008 00009 This software is provided 'as-is', without any express or implied 00010 warranty. In no event will the authors be held liable for any 00011 damages arising from the use of this software. 00012 00013 Permission is granted to anyone to use this software for any 00014 purpose, including commercial applications, and to alter it and 00015 redistribute it freely, subject to the following restrictions: 00016 00017 1. The origin of this software must not be misrepresented; you 00018 must not claim that you wrote the original software. If you use 00019 this software in a product, an acknowledgment in the product 00020 documentation would be appreciated but is not required. 00021 00022 2. Altered source versions must be plainly marked as such, and 00023 must not be misrepresented as being the original software. 00024 00025 3. This notice may not be removed or altered from any source 00026 distribution. 00027 00028 ---------------------------------------------------------------------------------*/ 00033 #ifndef _sassert_h_ 00034 #define _sassert_h_ 00035 00036 #ifdef __cplusplus 00037 extern "C" { 00038 #endif 00039 00040 #include "_ansi.h" 00041 00042 #undef sassert 00043 00044 #ifdef NDEBUG /* required by ANSI standard */ 00045 #define sassert(e,s) ((void)0) 00046 #else 00047 00048 #define sassert(e,msg) ((e) ? (void)0 : __sassert(__FILE__, __LINE__, #e, msg)) 00049 00050 #endif /* NDEBUG */ 00051 00052 void __sassert(const char *fileName, int lineNumber, const char* conditionString, const char* message); 00053 00054 #ifdef __cplusplus 00055 } 00056 #endif 00057 00058 #endif // _sassert_h_