Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / include / assert.h
blobb9e5e9b4add36ff2cc44f3a699ba283bdd7153b1
1 /*
2 assert.h
3 */
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
9 #include "_ansi.h"
11 #undef assert
13 #ifdef NDEBUG /* required by ANSI standard */
14 # define assert(__e) ((void)0)
15 #else
16 # define assert(__e) ((__e) ? (void)0 : __assert_func (__FILE__, __LINE__, \
17 __ASSERT_FUNC, #__e))
19 # ifndef __ASSERT_FUNC
20 /* Use g++'s demangled names in C++. */
21 # if defined __cplusplus && defined __GNUC__
22 # define __ASSERT_FUNC __PRETTY_FUNCTION__
24 /* C99 requires the use of __func__. */
25 # elif __STDC_VERSION__ >= 199901L
26 # define __ASSERT_FUNC __func__
28 /* Older versions of gcc don't have __func__ but can use __FUNCTION__. */
29 # elif __GNUC__ >= 2
30 # define __ASSERT_FUNC __FUNCTION__
32 /* failed to detect __func__ support. */
33 # else
34 # define __ASSERT_FUNC ((char *) 0)
35 # endif
36 # endif /* !__ASSERT_FUNC */
37 #endif /* !NDEBUG */
39 void __assert (const char *, int, const char *)
40 _ATTRIBUTE ((__noreturn__));
41 void __assert_func (const char *, int, const char *, const char *)
42 _ATTRIBUTE ((__noreturn__));
44 #if __STDC_VERSION__ >= 201112L && !defined __cplusplus
45 # define static_assert _Static_assert
46 #endif
48 #ifdef __cplusplus
50 #endif