comparison src/lisp.h @ 2535:4c1f2310451d

[xemacs-hg @ 2005-01-31 19:29:47 by ben] define ABORT always emacs.c: Define assert_failed() always. lisp.h: Always define ABORT().
author ben
date Mon, 31 Jan 2005 19:29:49 +0000
parents 989a7680c221
children c4c8a36043be
comparison
equal deleted inserted replaced
2534:27fda215142d 2535:4c1f2310451d
1 /* Fundamental definitions for XEmacs Lisp interpreter. 1 /* Fundamental definitions for XEmacs Lisp interpreter.
2 Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc. 2 Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc.
3 Copyright (C) 1993-1996 Richard Mlynarik. 3 Copyright (C) 1993-1996 Richard Mlynarik.
4 Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2004 Ben Wing. 4 Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005 Ben Wing.
5 5
6 This file is part of XEmacs. 6 This file is part of XEmacs.
7 7
8 XEmacs is free software; you can redistribute it and/or modify it 8 XEmacs is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the 9 under the terms of the GNU General Public License as published by the
1038 1038
1039 assert_at_line() is used for asserts inside of inline functions called 1039 assert_at_line() is used for asserts inside of inline functions called
1040 from error-checking macros. If we're not tricky, we just get the file 1040 from error-checking macros. If we're not tricky, we just get the file
1041 and line of the inline function, which is not very useful. */ 1041 and line of the inline function, which is not very useful. */
1042 1042
1043 #ifdef USE_ASSERTIONS
1044 /* Highly dubious kludge */ 1043 /* Highly dubious kludge */
1045 /* (thanks, Jamie, I feel better now -- ben) */ 1044 /* (thanks, Jamie, I feel better now -- ben) */
1046 MODULE_API void assert_failed (const Ascbyte *, int, const Ascbyte *); 1045 MODULE_API void assert_failed (const Ascbyte *, int, const Ascbyte *);
1047 # define ABORT() (assert_failed (__FILE__, __LINE__, "ABORT()")) 1046 #define ABORT() (assert_failed (__FILE__, __LINE__, "ABORT()"))
1047
1048 #ifdef USE_ASSERTIONS
1048 # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x)) 1049 # define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x))
1049 # define assert_with_message(x, msg) \ 1050 # define assert_with_message(x, msg) \
1050 ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, msg)) 1051 ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, msg))
1051 # define assert_at_line(x, file, line) \ 1052 # define assert_at_line(x, file, line) \
1052 ((x) ? (void) 0 : assert_failed (file, line, #x)) 1053 ((x) ? (void) 0 : assert_failed (file, line, #x))
1054 #elif defined (DEBUG_XEMACS)
1055 # define assert(x) ((x) ? (void) 0 : (void) ABORT ())
1056 # define assert_with_message(x, msg) ((x) ? (void) 0 : (void) ABORT ())
1057 # define assert_at_line(x, file, line) assert (x)
1053 #else 1058 #else
1054 # ifdef DEBUG_XEMACS 1059 # define assert(x) ((void) 0)
1055 # define assert(x) ((x) ? (void) 0 : (void) ABORT ()) 1060 # define assert_with_message(x, msg)
1056 # define assert_with_message(x, msg) ((x) ? (void) 0 : (void) ABORT ()) 1061 # define assert_at_line(x, file, line) assert (x)
1057 # define assert_at_line(x, file, line) assert (x)
1058 # else
1059 # define assert(x) ((void) 0)
1060 # define assert_with_message(x, msg)
1061 # define assert_at_line(x, file, line) assert (x)
1062 # endif
1063 #endif 1062 #endif
1064 1063
1065 /************************************************************************/ 1064 /************************************************************************/
1066 /** Memory allocation **/ 1065 /** Memory allocation **/
1067 /************************************************************************/ 1066 /************************************************************************/