GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


A Paste by Anonymous
#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