aboutsummaryrefslogtreecommitdiff
path: root/include/assert.h
blob: ceb71667a765141ce8b416ac047e8ee5b53f5860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef __ASSERT_H__
#define __ASSERT_H__

#include <stdio.h>

#ifdef __cplusplus
extern "C"
#endif
__declspec(dllimport) void __stdcall DebugBreak(void);

static __inline void __assert(int Cond)
{
#ifdef _DEBUG
  if (!Cond)
  {
    printf("assertion occured.\n");
    DebugBreak();
    while (1);
  }
#endif
}

#define assert(Cond) __assert((int)(Cond))

#endif