]> git.sur5r.net Git - cc65/blobdiff - src/common/check.h
One more place where OutputNameUsed must be flagged.
[cc65] / src / common / check.h
index 1049c4bf40ab19f2987c2417507f8d87da333830..5f8b31784be2b34393718efd2f2bc1ce5078e420 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 1998-2001 Ullrich von Bassewitz                                       */
+/*               Wacholderweg 14                                             */
+/*               D-70597 Stuttgart                                           */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -56,7 +56,7 @@ extern const char* MsgProgramAborted;         /* "Program aborted: "       */
 
 
 extern void (*CheckFailed) (const char* Msg, const char* Cond,
-                                   int Code, const char* File, unsigned Line)
+                                   const char* File, unsigned Line)
                            attribute ((noreturn));
 /* Function pointer that is called from check if the condition code is true. */
 
@@ -68,29 +68,20 @@ extern void (*CheckFailed) (const char* Msg, const char* Cond,
 
 
 
-void Check (const char* Msg, const char* Cond, int Code,
-            const char* File, unsigned Line);
-/* This function is called from all check macros (see below). It checks,
- * wether the given Code is true (!= 0). If so, it calls the CheckFailed
- * vector with the given strings. If not, it simply returns.
- */
-
-
-
-#define FAIL(s) CheckFailed (MsgInternalError, s, 0, __FILE__, __LINE__)
+#define FAIL(s) CheckFailed (MsgInternalError, s, __FILE__, __LINE__)
 /* Fail macro. Is used if something evil happens, calls checkfailed directly. */
 
-#define ABORT(s) CheckFailed (MsgProgramAborted, s, 0, __FILE__, __LINE__)
+#define ABORT(s) CheckFailed (MsgProgramAborted, s, __FILE__, __LINE__)
 /* Use this one instead of FAIL if there is no internal program error but an
  * error condition that is caused by the user or operating system (FAIL and
  * ABORT are essentially the same but the message differs).
  */
 
-#define PRECONDITION(c) Check (MsgPrecondition, #c, !(c), __FILE__, __LINE__)
-
-#define CHECK(c)        Check (MsgCheckFailed, #c, !(c), __FILE__, __LINE__)
+#define PRECONDITION(c) \
+    ((void) ((c)? 0 : (CheckFailed (MsgPrecondition, #c, __FILE__, __LINE__), 0)))
 
-#define ZCHECK(c)       Check (MsgCheckFailed, #c, c, __FILE__, __LINE__)
+#define CHECK(c)       \
+    ((void) ((c)? 0 : (CheckFailed (MsgCheckFailed, #c, __FILE__, __LINE__), 0)))