STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
assert.h
Go to the documentation of this file.
1 //
2 // assert.h
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // Defines the assert macro and related functionality.
7 //
8 #if defined _VCRT_BUILD && !defined _ASSERT_OK
9  #error assert.h not for CRT internal use
10 #endif
11 
12 #include <corecrt.h>
13 
15 
16 
17 
18 #undef assert
19 
20 #ifdef NDEBUG
21 
22  #define assert(expression) ((void)0)
23 
24 #else
25 
26  _ACRTIMP void __cdecl _wassert(
27  _In_z_ wchar_t const* _Message,
28  _In_z_ wchar_t const* _File,
29  _In_ unsigned _Line
30  );
31 
32  #define assert(expression) (void)( \
33  (!!(expression)) || \
34  (_wassert(_CRT_WIDE(#expression), _CRT_WIDE(__FILE__), (unsigned)(__LINE__)), 0) \
35  )
36 
37 #endif
38 
39 
40 
#define _ACRTIMP
Definition: corecrt.h:27
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:73
#define _In_z_
Definition: sal.h:310
#define _In_
Definition: sal.h:305
_CRT_BEGIN_C_HEADER _ACRTIMP void __cdecl _wassert(_In_z_ wchar_t const *_Message, _In_z_ wchar_t const *_File, _In_ unsigned _Line)
#define _CRT_END_C_HEADER
Definition: vcruntime.h:76