soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SAssertFmt.h
1#ifndef __SASSERTFMT__H__
2#define __SASSERTFMT__H__
3
4#ifdef _DEBUG
5#include <crtdbg.h>
6#define SASSERT_FMTW(expr, format, ...) (void)((!!(expr)) || (1 != _CrtDbgReportW(_CRT_ASSERT, _CRT_WIDE(__FILE__), __LINE__, NULL, format, __VA_ARGS__)) || (_CrtDbgBreak(), 0))
7
8#define SASSERT_FMTA(expr, format, ...) (void)((!!(expr)) || (1 != _CrtDbgReport(_CRT_ASSERT, __FILE__, __LINE__, NULL, format, __VA_ARGS__)) || (_CrtDbgBreak(), 0))
9
10#define SASSERT_MSGW(expr, msg) (void)((!!(expr)) || (1 != _CrtDbgReportW(_CRT_ASSERT, _CRT_WIDE(__FILE__), __LINE__, NULL, msg)) || (_CrtDbgBreak(), 0))
11
12#define SASSERT_MSGA(expr, msg) (void)((!!(expr)) || (1 != _CrtDbgReport(_CRT_ASSERT, __FILE__, __LINE__, NULL, msg)) || (_CrtDbgBreak(), 0))
13#else
14#define SASSERT_FMTW(expr, format, ...) \
15 if (!(expr)) \
16 SSLOGFMTW(format, ##__VA_ARGS__);
17
18#define SASSERT_FMTA(expr, format, ...) \
19 if (!(expr)) \
20 SSLOGFMTW(format, ##__VA_ARGS__);
21
22#define SASSERT_MSGA(expr, msg) \
23 if (!(expr)) \
24 SSLOGW() << msg;
25
26#define SASSERT_MSGW(expr, msg) SASSERT_MSGA(expr, msg)
27#endif
28
29#ifdef _UNICODE
30#define SASSERT_FMT SASSERT_FMTW
31#define SASSERT_MSG SASSERT_MSGW
32#else
33#define SASSERT_FMT SASSERT_FMTA
34#define SASSERT_MSG SASSERT_MSGA
35#endif //_UNICODE
36#endif // __SASSERTFMT__H__