aboutsummaryrefslogtreecommitdiff
path: root/include/assert.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/assert.h')
-rw-r--r--include/assert.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/assert.h b/include/assert.h
new file mode 100644
index 000000000..ceb71667a
--- /dev/null
+++ b/include/assert.h
@@ -0,0 +1,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
+