Use inline for better performance
git-svn-id: svn://svn.cc65.org/cc65/trunk@726 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -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 PRECONDITION(c) \
|
||||
{ if (!(c)) CheckFailed (MsgPrecondition, #c, __FILE__, __LINE__); }
|
||||
|
||||
#define CHECK(c) Check (MsgCheckFailed, #c, !(c), __FILE__, __LINE__)
|
||||
|
||||
#define ZCHECK(c) Check (MsgCheckFailed, #c, c, __FILE__, __LINE__)
|
||||
#define CHECK(c) \
|
||||
{ if (!(c)) CheckFailed (MsgCheckFailed, #c, __FILE__, __LINE__); }
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user