OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
OTAssert.h
Go to the documentation of this file.
1#pragma once
2
3// std header
4#include <cassert>
5
6#ifdef _DEBUG
8#define OTAssert(___expression, ___message) (void)((!!(___expression)) || (_wassert(_CRT_WIDE(#___expression) L"\n\n" _CRT_WIDE(___message), _CRT_WIDE(__FILE__), (unsigned)__LINE__), 0))
9
11#define OTAssertNullptr(___ptr) (void)((!!(___ptr != nullptr)) || (_wassert(_CRT_WIDE(#___ptr) _CRT_WIDE("\n\n[Caution]\nnullptr for \"") _CRT_WIDE(#___ptr) _CRT_WIDE("\"provided"), _CRT_WIDE(__FILE__), (unsigned)__LINE__), 0))
12
13#else
14
16#define OTAssert(___expression, ___message)
17
19#define OTAssertNullptr(___ptr)
20
21#endif // _DEBUG