aboutsummaryrefslogtreecommitdiffstats
path: root/include/assert.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-09-01 21:07:54 +0200
committerMattias Andrée <maandree@operamail.com>2015-09-01 21:07:54 +0200
commitac044784a6ce64ff15610d4b70750065a7f01b80 (patch)
tree8ac8629c0089099f21be9107a5d3779963d33ca0 /include/assert.h
parentadd memfrob (diff)
downloadslibc-ac044784a6ce64ff15610d4b70750065a7f01b80.tar.gz
slibc-ac044784a6ce64ff15610d4b70750065a7f01b80.tar.bz2
slibc-ac044784a6ce64ff15610d4b70750065a7f01b80.tar.xz
start on makefile and fixing warnings and errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'include/assert.h')
-rw-r--r--include/assert.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/include/assert.h b/include/assert.h
index 6315ae1..838a9bf 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -56,7 +56,7 @@
#define static_assert _Static_assert
-#ifndef __PORTABLE
+#if (defined(_SLIBC_SOURCE) || defined(_GNU_SOURCE)) && !defined(__PORTABLE)
/**
* Unless `NDEBUG` is defined, print an error message
* and abort the process, if `errnum` is non-zero.
@@ -65,15 +65,15 @@
*
* `assert_perror` is a GNU extension.
*/
-#if defined(_SLIBC_SOURCE) || defined(_GNU_SOURCE)
-#ifdef assert_perror
-# undef assert_perror
-#endif
-#ifdef NDEBUG
-# define assert_perror(errnum) ((void)0)
-#else
-# define assert_perror(errnum) \
+# ifdef assert_perror
+# undef assert_perror
+# endif
+# ifdef NDEBUG
+# define assert_perror(errnum) ((void)0)
+# else
+# define assert_perror(errnum) \
((void)((errnum == 0) ? 0 : (__assert_fail(NULL, errnum, __FILE__, __LINE__, __func__), 0)))
+# endif
#endif
@@ -89,7 +89,6 @@
*/
void __assert_fail(const char*, int, const char*, int, const char*)
__noreturn __GCC_ONLY(__attribute__((nonnull(3, 4, 5))));
-#endif