ReactOS  0.4.15-dev-320-g2dc9f0a
fbtxcpt.h
Go to the documentation of this file.
1 #ifndef _FBT_EXCEPT_H
2 
3 #include "fbtLog.h"
4 
5 #ifdef __cplusplus
6 
7 #include "fbtSeXcpt.h"
8 
9 #define FBT_TRY try {
10 #define FBT_CATCH } catch (fbtSeException *e) { fbtLog(fbtLog_Failure, "Exception %08X caught at line %u in file %s", e->GetSeCode(), __LINE__, __FILE__); fbtLog(fbtLog_Exception, "Exception %08X caught at line %u in file %s", e->GetSeCode(), __LINE__, __FILE__);
11 #define FBT_CATCH_RETURN(RETVAL) FBT_CATCH return RETVAL;}
12 #define FBT_CATCH_NORETURN FBT_CATCH return;}
13 
14 #else
15 
16 #define FBT_TRY __try{
17 #define FBT_CATCH } __except(EXCEPTION_EXECUTE_HANDLER) { fbtLog(fbtLog_Failure, "Exception %08X caught at line %u in file %s (%s)", GetExceptionCode(), __LINE__, __FILE__, GetCommandLine()); fbtLog(fbtLog_Exception, "Exception %08X caught at line %u in file %s (%s)", GetExceptionCode(), __LINE__, __FILE__, GetCommandLine());
18 #define FBT_CATCH_RETURN(RETVAL) FBT_CATCH return RETVAL;}
19 #define FBT_CATCH_NORETURN FBT_CATCH return;}
20 #define FBT_CATCH_NODEBUG_RETURN(x) } __except(EXCEPTION_EXECUTE_HANDLER) { return x;}
21 
22 #endif // __cplusplus
23 
24 #endif _FBT_EXCEPT_H