New Paste :: Recent Pastes:: No Line Numbers
A Paste by Anonymous
1
#ifndef _MASSERT_H__ #define _MASSERT_H__ /////////////////////////////////////////////////////////////////////// extern "C" { extern const char* __FNNAME__; void _pushFunctionName( const char* fnName ); void _mAssert( const char* fnName, const char* fileName, int line, const char* exp, bool& ignore ); } /////////////////////////////////////////////////////////////////////// class StackHelper { public: ~StackHelper(); }; /////////////////////////////////////////////////////////////////////// #define NAME_FUNCTION(name) StackHelper helper;static const char* __FNNAME__=#name; _pushFunctionName(__FNNAME__); #define MASSERT(exp) {static bool ignore=false;if(!exp){_mAssert( __FNNAME__, __FILE__, __LINE__, #exp, ignore);}} #endif