#ifndef _KOK_ASSERT_H_
#define _KOK_ASSERT_H_
#pragma once
#ifdef WIN32
#ifndef _DEBUG
#define Assert(expr) (void)0
#else
#include <windows.h>
#include <cstdio>
#define _KOK_UNICODE_STRING(str) L##str
#define KOK_UNICODE_STRING(str) _KOK_UNICODE_STRING(str)
bool WSAssert(wchar_t* pExpr, wchar_t* pFile, unsigned uline)
{
wchar_t buffer[2*MAX_PATH];
swprintf(buffer, KOK_UNICODE_STRING("Assertion failed: %s/n at File: %s, Line: %d/n"), pExpr, pFile, uline);
MessageBoxW(NULL, buffer, KOK_UNICODE_STRING("Assertion failed!!!"), MB_OK);
return 0;
}
#define KOK_ASSERT(expr) /
if(!(expr)) /
{ /
WSAssert(KOK_UNICODE_STRING(#expr), KOK_UNICODE_STRING(__FILE__), __LINE__); /
__asm int 3 /
}
#endif
#endif
#endif