#define guard(s) static char * __FUNCTION_NAME__ = #s; \
try {
#define unguard } catch (...) { \
Log( "Exception in: %s\n", __FUNCTION_NAME__ ); \
throw }
Here is my modification, to include some error handling too.
//Exception Handler--------------------------------------------------------
#define guard(s) static char * __FUNCTION_NAME__ = #s; try {
#define unguard } catch (char *cs) { string st=cs; st+="\nException in: "; st+=__FUNCTION_NAME__; st+='\n'; throw st; } catch (string str){throw str;} catch (...) { string cs="Exception in: "; cs+=__FUNCTION_NAME__; cs+='\n'; throw cs; }
//-------------------------------------------------------------------------
Just thought it might benifit you.
Reality Makes Me XIC
I don't do spelling, I hack code: passion is my feul. Use my programs, experience genius.
http://www.x-i-c.com/
Edited by - JmarsKoder on June 28, 2001 11:17:59 AM