xref: /reactos/sdk/include/crt/assert.h (revision 84344399)
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 <corecrt.h>
10 
11 #ifdef NDEBUG
12 
13 #ifndef assert
14 #define assert(_Expression) ((void)0)
15 #endif
16 
17 #else /* !NDEBUG */
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23   _CRTIMP
24   void
25   __cdecl
26   _assert(
27     _In_z_ const char *_Message,
28     _In_z_ const char *_File,
29     _In_ unsigned _Line);
30 
31   _CRTIMP
32   void
33   __cdecl
34   _wassert(
35     _In_z_ const wchar_t *_Message,
36     _In_z_ const wchar_t *_File,
37     _In_ unsigned _Line);
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 #ifndef assert
44 #define assert(_Expression) (void)((!!(_Expression)) || (_assert(#_Expression,__FILE__,__LINE__),0))
45 #endif
46 
47 #ifndef wassert
48 #define wassert(_Expression) (void)((!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
49 #endif
50 
51 #endif
52 
53 #endif
54