[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Win32 PFile
Ignore the debug.h.diff in the previous mail. I forgot to strip the
linefeeds.
I have attached a better diff.
29,30c29
< extern const char* _ppNoFuncNameMsg;
< #define PP_FUNCTION_NAME _ppNoFuncNameMsg
---
> #define PP_FUNCTION_NAME "Unknown Function"
116a116,133
> #ifdef PP_SYS_OS_WIN32
> #ifndef WIN32_LEAN_AND_MEAN
> #define WIN32_LEAN_AND_MEAN
> #define STRICT
> #endif
> #include <windows.h>
> #define PP_DEBUG_BREAK DebugBreak()
> #else
> #define PP_DEBUG_BREAK 0
> #endif
>
> #define ppEvilTrick(FunPointer) (\
> PP_DEBUG_BREAK, \
> *_pp_db_lineno_loc()=__LINE__,\
> *_pp_db_file_loc()=__FILE__,\
> *_pp_db_func_loc()=PP_FUNCTION_NAME,\
> FunPointer \
> )
131,136c148
< #define ppFatalError (\
< *_pp_db_lineno_loc()=__LINE__,\
< *_pp_db_file_loc()=__FILE__,\
< *_pp_db_func_loc()=PP_FUNCTION_NAME,\
< _ppFatalError\
< )
---
> #define ppFatalError ppEvilTrick(_ppFatalError)
143,148c155,156
< #define ppInternalError (\
< *_pp_db_lineno_loc()=__LINE__,\
< *_pp_db_file_loc()=__FILE__,\
< *_pp_db_func_loc()=PP_FUNCTION_NAME,\
< _ppInternalError\
< )
---
> #define ppInternalError ppEvilTrick(_ppInternalError)
>
158,163c166,168
< #define ppWarning (\
< *_pp_db_lineno_loc()=__LINE__,\
< *_pp_db_file_loc()=__FILE__,\
< *_pp_db_func_loc()=PP_FUNCTION_NAME,\
< _ppWarning\
< )
---
> #define ppWarning ppEvilTrick(_ppWarning)
>
> #define ppError ppEvilTrick(_ppError)
165,170d169
< #define ppError (\
< *_pp_db_lineno_loc()=__LINE__,\
< *_pp_db_file_loc()=__FILE__,\
< *_pp_db_func_loc()=PP_FUNCTION_NAME,\
< _ppError\
< )
178,183c177,178
< #define ppAssert(expr) (\
< *_pp_db_lineno_loc()=__LINE__,\
< *_pp_db_file_loc()=__FILE__,\
< *_pp_db_func_loc()=PP_FUNCTION_NAME,\
< ((expr) ? (void) (0) : _ppInternalError ("Assertion \"%s\" failed", #expr))\
< )
---
> #define ppAssert(expr) \
> if (!(expr)) {ppEvilTrick(_ppInternalError ("Assertion \"%s\" failed", #expr));}
185,190c180,183
< #define ppAssertArg(expr) (\
< *_pp_db_lineno_loc()=__LINE__,\
< *_pp_db_file_loc()=__FILE__,\
< *_pp_db_func_loc()=PP_FUNCTION_NAME,\
< ((expr) ? (void) (0) : _ppInternalError ("Invalid Argument: Assertion \"%s\" does not hold", #expr))\
< )
---
>
> #define ppAssertArg(expr) \
> if (!(expr)) {ppEvilTrick(_ppInternalError ("Invalid Argument: Assertion \"%s\" does not hold", #expr));}
>
207,212c200
< #define ppDebug1 (\
< *_pp_db_lineno_loc()=__LINE__,\
< *_pp_db_file_loc()=__FILE__,\
< *_pp_db_func_loc()=PP_FUNCTION_NAME,\
< _ppDebug\
< )
---
> #define ppDebug1 ppEvilTrick(_ppDebug)