25 #ifndef _ODE__PRIVATE_ERROR_H_
26 #define _ODE__PRIVATE_ERROR_H_
28 #include <ode/error.h>
42 # if defined(__STDC__) && __STDC_VERSION__ >= 199901L
43 # define __FUNCTION__ __func__
47 # define dIASSERT(a) { if (!(a)) { dDebug (d_ERR_IASSERT, \
48 "assertion \"" #a "\" failed in %s() [%s:%u]",__FUNCTION__,__FILE__,__LINE__); } }
49 # define dUASSERT(a,msg) { if (!(a)) { dDebug (d_ERR_UASSERT, \
50 msg " in %s()", __FUNCTION__); } }
51 # define dDEBUGMSG(msg) { dMessage (d_ERR_UASSERT, \
52 msg " in %s() [%s:%u]", __FUNCTION__,__FILE__,__LINE__); }
53 # else // not __GNUC__
54 # define dIASSERT(a) { if (!(a)) { dDebug (d_ERR_IASSERT, \
55 "assertion \"" #a "\" failed in %s:%u",__FILE__,__LINE__); } }
56 # define dUASSERT(a,msg) { if (!(a)) { dDebug (d_ERR_UASSERT, \
57 msg " (%s:%u)", __FILE__,__LINE__); } }
58 # define dDEBUGMSG(msg) { dMessage (d_ERR_UASSERT, \
59 msg " (%s:%u)", __FILE__,__LINE__); }
61 # define dIVERIFY(a) dIASSERT(a)
63 # define dIASSERT(a) ((void)0)
64 # define dUASSERT(a,msg) ((void)0)
65 # define dDEBUGMSG(msg) ((void)0)
66 # define dIVERIFY(a) ((void)(a))
70 # define dICHECK(a) { if (!(a)) { dDebug (d_ERR_IASSERT, \
71 "assertion \"" #a "\" failed in %s() [%s:%u]",__FUNCTION__,__FILE__,__LINE__); *(int *)0 = 0; } }
72 # else // not __GNUC__
73 # define dICHECK(a) { if (!(a)) { dDebug (d_ERR_IASSERT, \
74 "assertion \"" #a "\" failed in %s:%u",__FILE__,__LINE__); *(int *)0 = 0; } }
78 #define dAASSERT(a) dUASSERT(a,"Bad argument(s)")