From 58d798868d9163a6ee5a17367e947a4a1c4da0e5 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Tue, 25 Mar 2003 21:26:01 +0000 Subject: only abort() in DEBUG versions CVS patchset: 4483 CVS date: 2003/03/25 21:26:01 --- src/xine-utils/xineutils.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 40c3ae926..2fe21dca2 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.46 2003/03/07 19:58:32 miguelfreitas Exp $ + * $Id: xineutils.h,v 1.47 2003/03/25 21:26:01 heikos Exp $ * */ #ifndef XINEUTILS_H @@ -796,36 +796,41 @@ extern int v_b_table[256]; /* backtrace printout funtion for use in XINE_ASSERT() macro */ void xine_print_trace(void); + +#ifdef DEBUG +# define XINE_ABORT() \ + abort(); +#else +# define XINE_ABORT() + /* don't abort */ +#endif + /** * Provide assert like feature with better description of failure * Thanks to Mark Thomas */ -#ifndef NDEBUG -# if __GNUC__ -# define XINE_ASSERT(exp, desc, args...) \ +#if __GNUC__ +# define XINE_ASSERT(exp, desc, args...) \ do { \ if (!(exp)) { \ printf("%s:%s:%d: assertion `%s' failed. " desc "\n\n", \ __FILE__, __XINE_FUNCTION__, __LINE__, #exp, ##args); \ xine_print_trace(); \ - abort(); \ + XINE_ABORT(); \ } \ } while(0) -# else /* not GNU C, assume we have a C99 compiler */ -# define XINE_ASSERT(exp, ...) \ +#else /* not GNU C, assume we have a C99 compiler */ +# define XINE_ASSERT(exp, ...) \ do { \ if (!(exp)) { \ printf("%s:%s:%d: assertion `%s' failed. ", \ __FILE__, __XINE_FUNCTION__, __LINE__, #exp); \ printf(__VA_ARGS__); \ printf("\n\n"); \ - xine_print_trace(); \ - abort(); \ + xine_print_trace(); \ + XINE_ABORT(); \ } \ } while(0) -# endif -#else -# define XINE_ASSERT(...) /**/ #endif -- cgit v1.2.3