fix _ALL_SOURCE logic to avoid possible redefinition of _GNU_SOURCE
[musl] / include / assert.h
index bad2ccd..1ee02a4 100644 (file)
@@ -1,9 +1,15 @@
+#include <features.h>
+
 #undef assert
 
 #ifdef NDEBUG
 #define        assert(x) (void)0
 #else
-#define assert(x) ((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0))
+#define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
+#endif
+
+#ifndef __cplusplus
+#define static_assert _Static_assert
 #endif
 
 #ifdef __cplusplus