From 29c4caea228ce22a9bfa76ef833d4473a9be8979 Mon Sep 17 00:00:00 2001 From: Nelson Ferreira Date: Sun, 27 Sep 2015 17:28:23 -0400 Subject: [PATCH] Fixup assert definitions. * src/sxe-utils.h: Use assert_failed only when compiling emacs itself. Also make assert a proper no-op expression, i.e., (void)0. Signed-off-by: Nelson Ferreira --- src/sxe-utils.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sxe-utils.h b/src/sxe-utils.h index 60b526d..5d7dabb 100644 --- a/src/sxe-utils.h +++ b/src/sxe-utils.h @@ -108,13 +108,12 @@ along with this program. If not, see . */ #define SXE_CRITICAL(args...) __SXE_DEBUG__("CRITICAL: " args) - /* We define assert iff USE_ASSERTIONS or DEBUG_SXEMACS is defined. Otherwise we define it to be empty. Quantify has shown that the time the assert checks take is measurable so let's not include them in production binaries. */ -#ifdef USE_ASSERTIONS +#if defined(USE_ASSERTIONS) && defined(emacs) /* Highly dubious kludge */ /* (thanks, Jamie, I feel better now -- ben) */ void assert_failed(const char *, int, const char *); @@ -124,7 +123,7 @@ void assert_failed(const char *, int, const char *); # ifdef DEBUG_SXEMACS # define assert(x) ((x) ? (void) 0 : (void) abort ()) # else -# define assert(x) +# define assert(x) ((void)0) # endif #endif -- 2.25.1