Commit WIP. Part 1 of ??
[reactos.git] / reactos / include / crt / assert.h
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6 #ifndef __ASSERT_H_
7 #define __ASSERT_H_
8
9 #include <_mingw.h>
10 #ifdef __cplusplus
11 #include <stdlib.h>
12 #endif
13
14 #ifdef NDEBUG
15 #ifndef assert
16 #define assert(_Expression) ((void)0)
17 #endif
18 #else
19
20 #ifndef _CRT_TERMINATE_DEFINED
21 #define _CRT_TERMINATE_DEFINED
22 __declspec(noreturn) void __cdecl exit(int _Code);
23 _CRTIMP __declspec(noreturn) void __cdecl _exit(int _Code);
24 #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
25 /* C99 function name */
26 void __cdecl __declspec(noreturn) _Exit(int); /* Declare to get noreturn attribute. */
27 __CRT_INLINE void __cdecl _Exit(int status)
28 { _exit(status); }
29 #endif
30
31 #ifdef _WIN64 //hack for old gcc in ROSBE
32 #pragma push_macro("abort")
33 #undef abort
34 #endif
35 void __cdecl __declspec(noreturn) abort(void);
36 #ifdef _WIN64 //hack for old gcc in ROSBE
37 #pragma pop_macro("abort")
38 #endif
39
40 #endif
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 //extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line);
47
48 #ifdef __cplusplus
49 }
50 #endif
51
52 #ifndef assert
53 #define assert(_Expression) (void)((!!(_Expression)))// || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
54 #endif
55
56 #endif
57
58 #endif