aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/native/fdlibm/java-assert.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@gcc.gnu.org>2005-07-16 00:30:23 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-07-16 00:30:23 +0000
commitf911ba985aa7fe0096c386c5be385ac5825ea527 (patch)
treea0b991cf5866ae1d616639b906ac001811d74508 /libjava/classpath/native/fdlibm/java-assert.h
parent6f4434b39b261de5317dc81ddfdd94d2e1d62b11 (diff)
downloadgcc-f911ba985aa7fe0096c386c5be385ac5825ea527.zip
gcc-f911ba985aa7fe0096c386c5be385ac5825ea527.tar.gz
gcc-f911ba985aa7fe0096c386c5be385ac5825ea527.tar.bz2
Initial revision
From-SVN: r102074
Diffstat (limited to 'libjava/classpath/native/fdlibm/java-assert.h')
-rw-r--r--libjava/classpath/native/fdlibm/java-assert.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/libjava/classpath/native/fdlibm/java-assert.h b/libjava/classpath/native/fdlibm/java-assert.h
new file mode 100644
index 0000000..6f178bd
--- /dev/null
+++ b/libjava/classpath/native/fdlibm/java-assert.h
@@ -0,0 +1,38 @@
+// java-assert.h - Header file holding assertion definitions. -*- c++ -*-
+
+/* Copyright (C) 1998, 1999 Free Software Foundation
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#ifndef __JAVA_ASSERT_H__
+#define __JAVA_ASSERT_H__
+
+// This is a libgcj implementation header.
+
+void _Jv_Abort (const char *, const char *, int, const char *)
+ __attribute__ ((__noreturn__));
+
+#ifdef DEBUG
+#define _Jv_AssertDoCall(Message) _Jv_Abort (__FUNCTION__, __FILE__, __LINE__, Message)
+
+#define JvAssertMessage(Expr, Message) \
+ do { if (! (Expr)) _Jv_AssertDoCall (Message); } while (0)
+#define JvAssert(Expr) \
+ do { if (! (Expr)) _Jv_AssertDoCall (# Expr); } while (0)
+
+#define JvFail(Message) _Jv_AssertDoCall (Message)
+
+#else /* DEBUG */
+
+#define _Jv_AssertDoCall(Message)
+#define JvAssertMessage(Expr, Message)
+#define JvAssert(Expr)
+#define JvFail(Message) _Jv_Abort (0, 0, 0, Message)
+
+#endif /* not DEBUG */
+
+#endif /* __JAVA_ASSERT_H__ */