summaryrefslogtreecommitdiff
path: root/lib/int_lib.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-03-31 17:00:48 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-03-31 17:00:48 +0000
commitd3d22631ca0b314f0564a9bcfe96dd2d6ca85fa6 (patch)
tree769c0aff878accac1216a06b777b0abb0b3180f6 /lib/int_lib.h
parent48f46ac1d9a82210f6e469567cb60aa7e7cd2f3b (diff)
downloadcompiler-rt-d3d22631ca0b314f0564a9bcfe96dd2d6ca85fa6.tar.gz
compiler-rt-d3d22631ca0b314f0564a9bcfe96dd2d6ca85fa6.tar.bz2
compiler-rt-d3d22631ca0b314f0564a9bcfe96dd2d6ca85fa6.tar.xz
Add new build option KERNEL_USE, which compiles with -mkernel and gets propogated to CFLAGS. Use this to call panic() instead of abort() when enabled.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@100015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/int_lib.h')
-rw-r--r--lib/int_lib.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/int_lib.h b/lib/int_lib.h
index f6c2dd45..912a12f5 100644
--- a/lib/int_lib.h
+++ b/lib/int_lib.h
@@ -23,7 +23,14 @@
#include "endianness.h"
#include <math.h>
+/* If compiling for kernel use, call panic() instead of abort(). */
+#ifdef KERNEL_USE
+extern void panic (const char *, ...);
+#define compilerrt_abort() \
+ panic("%s:%d: abort in %s", __FILE__, __LINE__, __FUNCTION__)
+#else
#define compilerrt_abort() abort()
+#endif
#if !defined(INFINITY) && defined(HUGE_VAL)
#define INFINITY HUGE_VAL