macos: workaround to build tcc using tcc until .o object files generated by tcc are...
[tinycc.git] / win32 / include / assert.h
blobb15bb6383faba3b4c14c5108ba8cdf62895277b3
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_
9 #include <_mingw.h>
10 #ifdef __cplusplus
11 #include <stdlib.h>
12 #endif
14 #ifdef NDEBUG
15 #ifndef assert
16 #define assert(_Expression) ((void)0)
17 #endif
18 #else
20 #ifndef _CRT_TERMINATE_DEFINED
21 #define _CRT_TERMINATE_DEFINED
22 void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN;
23 _CRTIMP void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN;
24 #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
25 /* C99 function name */
26 void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN;
27 __CRT_INLINE __MINGW_ATTRIB_NORETURN void __cdecl _Exit(int status)
28 { _exit(status); }
29 #endif
31 #pragma push_macro("abort")
32 #undef abort
33 void __cdecl __declspec(noreturn) abort(void);
34 #pragma pop_macro("abort")
36 #endif
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
43 extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line);
44 extern void __cdecl _assert(const char *, const char *, unsigned);
46 #ifdef __cplusplus
48 #endif
50 #ifndef assert
51 //#define assert(_Expression) (void)((!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
52 #define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
53 #endif
55 #endif
57 #if (__STDC_VERSION__ >= 201112L) && !defined(static_assert)
58 /* C11, section 7.2: The macro static_assert expands to _Static_assert. */
59 #define static_assert(exp, str) _Static_assert(exp, str)
60 #endif
62 #endif