NOTE: This patch has been committed.
src/ChangeLog addition:
2005-01-31 Ben Wing <ben(a)xemacs.org>
* emacs.c:
Define assert_failed() always.
* lisp.h:
Always define ABORT().
build source patch:
Diff command: bash -ci "cvs-diff --show-c-function -no-changelog "
Files affected: src/lisp.h src/emacs.c
Index: src/emacs.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/emacs.c,v
retrieving revision 1.153
diff -u -p -r1.153 emacs.c
--- src/emacs.c 2005/01/28 02:36:24 1.153
+++ src/emacs.c 2005/01/31 18:29:11
@@ -3796,7 +3796,6 @@ mswindows_handle_hardware_exceptions (DW
in one session without having to recompile. */
/* #define ASSERTIONS_DONT_ABORT */
-#ifdef USE_ASSERTIONS
/* This highly dubious kludge ... shut up Jamie, I'm tired of your slagging. */
/* Nonzero if handling an assertion failure. (Bumped by one each time
@@ -3896,7 +3895,6 @@ assert_failed (const Ascbyte *file, int
inhibit_non_essential_conversion_operations = 0;
in_assert_failed = 0;
}
-#endif /* USE_ASSERTIONS */
/* -------------------------------------- */
/* low-memory notification */
Index: src/lisp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.120
diff -u -p -r1.120 lisp.h
--- src/lisp.h 2005/01/28 02:36:25 1.120
+++ src/lisp.h 2005/01/31 18:29:14
@@ -1,7 +1,7 @@
/* Fundamental definitions for XEmacs Lisp interpreter.
Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc.
Copyright (C) 1993-1996 Richard Mlynarik.
- Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2004 Ben Wing.
+ Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005 Ben Wing.
This file is part of XEmacs.
@@ -1040,26 +1040,25 @@ BEGIN_C_DECLS
from error-checking macros. If we're not tricky, we just get the file
and line of the inline function, which is not very useful. */
-#ifdef USE_ASSERTIONS
/* Highly dubious kludge */
/* (thanks, Jamie, I feel better now -- ben) */
MODULE_API void assert_failed (const Ascbyte *, int, const Ascbyte *);
-# define ABORT() (assert_failed (__FILE__, __LINE__, "ABORT()"))
+#define ABORT() (assert_failed (__FILE__, __LINE__, "ABORT()"))
+
+#ifdef USE_ASSERTIONS
# define assert(x) ((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, #x))
# define assert_with_message(x, msg) \
((x) ? (void) 0 : assert_failed (__FILE__, __LINE__, msg))
# define assert_at_line(x, file, line) \
((x) ? (void) 0 : assert_failed (file, line, #x))
+#elif defined (DEBUG_XEMACS)
+# define assert(x) ((x) ? (void) 0 : (void) ABORT ())
+# define assert_with_message(x, msg) ((x) ? (void) 0 : (void) ABORT ())
+# define assert_at_line(x, file, line) assert (x)
#else
-# ifdef DEBUG_XEMACS
-# define assert(x) ((x) ? (void) 0 : (void) ABORT ())
-# define assert_with_message(x, msg) ((x) ? (void) 0 : (void) ABORT ())
-# define assert_at_line(x, file, line) assert (x)
-# else
-# define assert(x) ((void) 0)
-# define assert_with_message(x, msg)
-# define assert_at_line(x, file, line) assert (x)
-# endif
+# define assert(x) ((void) 0)
+# define assert_with_message(x, msg)
+# define assert_at_line(x, file, line) assert (x)
#endif
/************************************************************************/