* Slim fdlibm version from GNU classpath, we need these functions (finite,
[cacao.git] / src / fdlibm / java-assert.h
1 /* java-assert.h - Header file holding assertion definitions.  -*- c++ -*- */
2
3 /* Copyright (C) 1998, 1999  Free Software Foundation
4
5    This file is part of libgcj.
6
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
9 details.  */
10
11 #ifndef __JAVA_ASSERT_H__
12 #define __JAVA_ASSERT_H__
13
14 #include "config.h"
15
16 /* This is a libgcj implementation header. */
17
18 void _Jv_Abort (const char *, const char *, int, const char *)
19   __attribute__ ((__noreturn__));
20
21 #ifdef DEBUG
22 #define _Jv_AssertDoCall(Message) _Jv_Abort (__FUNCTION__, __FILE__, __LINE__, Message)
23
24 #define JvAssertMessage(Expr, Message) \
25    do { if (! (Expr)) _Jv_AssertDoCall (Message); } while (0)
26 #define JvAssert(Expr) \
27    do { if (! (Expr)) _Jv_AssertDoCall (# Expr); } while (0)
28
29 #define JvFail(Message) _Jv_AssertDoCall (Message)
30
31 #else /* DEBUG */
32
33 #define _Jv_AssertDoCall(Message)
34 #define JvAssertMessage(Expr, Message)
35 #define JvAssert(Expr)
36 #define JvFail(Message) _Jv_Abort (0, 0, 0, Message)
37
38 #endif /* not DEBUG */
39
40 #endif /* __JAVA_ASSERT_H__ */