Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

nullpo.h

00001 // $Id: nullpo.h 1 2006-01-13 22:47:50Z MagicalTux $
00002 #ifndef _NULLPO_H_
00003 #define _NULLPO_H_
00004 
00005 #define NULLPO_CHECK 1
00006 
00007 #if __STDC_VERSION__ < 199901L
00008 # if __GNUC__ >= 2
00009 #  define __func__ __FUNCTION__
00010 # else
00011 #  define __func__ ""
00012 # endif
00013 #endif
00014 
00015 #ifdef LCCWIN32
00016 /* This is only required with LCCWIN32 and not with gcc Win32 */
00017 #define __attribute__(x)        // nothing
00018 #endif
00019 
00020 #define NLP_MARK __FILE__, __LINE__, __func__
00021 
00022 /*----------------------------------------------------------------------------
00023  * Macros
00024  *----------------------------------------------------------------------------
00025  */
00026 #if NULLPO_CHECK
00027 
00028 void nullpo_info_core_simple(const char *file, int line, const char *func);
00029 
00030 #define nullpo_ret(t) if (!(t)) { nullpo_info_core_simple(NLP_MARK); return 0; }
00031 #define nullpo_retv(t) if (!(t)) { nullpo_info_core_simple(NLP_MARK); return; }
00032 #define nullpo_retr(ret, t) if (!(t)) { nullpo_info_core_simple(NLP_MARK); return (ret); }
00033 
00034 #else /* NULLPO_CHECK */
00035 /* No Nullpo check */
00036 
00037 #define nullpo_ret(t) if ((t)) { ; }
00038 #define nullpo_retv(t) if ((t)) { ;}
00039 #define nullpo_retr(ret, t) if ((t)) { ; }
00040 
00041 #endif /* NULLPO_CHECK */
00042 
00043 #endif // _NULLPO_H_

Generated on Fri Apr 28 10:20:05 2006 for OpenAthena by  doxygen 1.4.4