1 /***************************************************************************** 2 * myassert.h 3 * 4 * DESCRIPTION 5 * This file contains the code to handle assert statements. There is no 6 * actual code unless DEBUG is defined. 7 * 8 * HISTORY 9 * 12/2003 Arthur Taylor (MDL / RSIS): Created. 10 * 11 * NOTES 12 ***************************************************************************** 13 */ 14 #ifndef MYASSERT_H 15 #define MYASSERT_H 16 17 #ifndef CPL_C_START 18 #ifdef __cplusplus 19 # define CPL_C_START extern "C" { 20 # define CPL_C_END } 21 #else 22 # define CPL_C_START 23 # define CPL_C_END 24 #endif 25 #endif 26 27 #ifdef DEBUG 28 CPL_C_START 29 void _myAssert (const char *file, int lineNum); 30 CPL_C_END 31 32 #define myAssert(f) \ 33 if (f) \ 34 {} \ 35 else \ 36 _myAssert (__FILE__, __LINE__) 37 #else 38 #define myAssert(f) 39 #endif 40 41 #endif 42