From 56d6c494b85cceed70595839877f74dca7ffcb02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Fri, 17 Jul 1998 14:33:52 +0200
Subject: [PATCH] Added macro ASSERT_ONERROR().

Rev: src/error.h:1.24
---
 src/error.h | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/error.h b/src/error.h
index 01bd1349cc..fcf39f1852 100644
--- a/src/error.h
+++ b/src/error.h
@@ -5,7 +5,7 @@
 \*/
 
 /*
- * $Id: error.h,v 1.23 1998/07/16 23:09:39 hubbe Exp $
+ * $Id: error.h,v 1.24 1998/07/17 12:33:52 grubba Exp $
  */
 #ifndef ERROR_H
 #define ERROR_H
@@ -120,7 +120,16 @@ extern int throw_severity;
     } \
     recoveries->onerror=(X).previous; \
   } while(0)
-#else
+
+#define ASSERT_ONERROR(X) \
+  do{ \
+    if (!recoveries) break; \
+    if (recoveries->onerror != &X) { \
+      fatal("%s:%d ASSERT_ONERROR(%p) failed\n", \
+            __FILE__, __LINE__, &(X)); \
+    } \
+  }while(0)
+#else /* !DEBUG */
 #define SET_ONERROR(X,Y,Z) \
   do{ \
      if(!recoveries) break; \
@@ -131,7 +140,9 @@ extern int throw_severity;
   }while(0)
 
 #define UNSET_ONERROR(X) recoveries && (recoveries->onerror=X.previous)
-#endif
+
+#define ASSERT_ONERROR(X)
+#endif /* DEBUG */
 
 #if defined(DEBUG) && 0
 /* Works, but probably not interresting for most people
-- 
GitLab