aboutsummaryrefslogtreecommitdiff
path: root/more-hdrs/assert.h
diff options
context:
space:
mode:
author(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-09 23:20:13 +0000
committer(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-09 23:20:13 +0000
commit56dc9c7e121493f4a4225bbfa4be4d65b1753c66 (patch)
tree3dd34a8c34793776e40587f22f12789ab230d69d /more-hdrs/assert.h
parent9e0f9ffc44b45e738ae0321183bdc41f7c889c81 (diff)
This commit was manufactured by cvs2svn to create tagapple/gcc-5000
'apple-gcc-5000'. git-svn-id: https://gcc.gnu.org/svn/gcc/tags/apple-gcc-5000@96220 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'more-hdrs/assert.h')
-rw-r--r--more-hdrs/assert.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/more-hdrs/assert.h b/more-hdrs/assert.h
new file mode 100644
index 00000000000..0bd55b020c8
--- /dev/null
+++ b/more-hdrs/assert.h
@@ -0,0 +1,71 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/usr/include/assert.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+#ifndef FIXINC_BROKEN_ASSERT_STDLIB_CHECK
+#define FIXINC_BROKEN_ASSERT_STDLIB_CHECK 1
+
+#ifdef __cplusplus
+#include <stdlib.h>
+#endif
+/* Allow this file to be included multiple times
+ with different settings of NDEBUG. */
+#undef assert
+#undef __assert
+
+#ifdef NDEBUG
+#define assert(ignore) ((void) 0)
+#else
+
+#ifndef __GNUC__
+
+#define assert(expression) \
+ ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
+
+#define __assert(expression, file, lineno) \
+ (printf ("%s:%u: failed assertion\n", file, lineno), \
+ abort (), 0)
+
+#else
+
+#if defined(__STDC__) || defined (__cplusplus)
+
+/* Defined in libgcc.a */
+#ifdef __cplusplus
+extern "C" {
+extern void __eprintf (const char *, const char *, unsigned, const char *)
+ __attribute__ ((noreturn));
+}
+#else
+extern void __eprintf (const char *, const char *, unsigned, const char *)
+ __attribute__ ((noreturn));
+#endif
+
+#define assert(expression) \
+ ((void) ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__)))
+
+#define __assert(expression, file, line) \
+ (__eprintf ("%s:%u: failed assertion `%s'\n", \
+ file, line, expression), 0)
+
+#else /* no __STDC__ and not C++; i.e. -traditional. */
+
+extern void __eprintf () __attribute__ ((noreturn)); /* Defined in libgcc.a */
+
+#define assert(expression) \
+ ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
+
+#define __assert(expression, file, lineno) \
+ (__eprintf ("%s:%u: failed assertion `%s'\n", \
+ file, lineno, "expression"), 0)
+
+#endif /* no __STDC__ and not C++; i.e. -traditional. */
+#endif /* no __GNU__; i.e., /bin/cc. */
+#endif
+
+#endif /* FIXINC_BROKEN_ASSERT_STDLIB_CHECK */