From: uz Date: Sun, 8 Mar 2009 14:54:53 +0000 (+0000) Subject: New functions LIWarning and LIError. X-Git-Tag: V2.13.0rc1~294 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ffa8e7be825eb418799cbe5e5e29e8158c0855bb;p=cc65 New functions LIWarning and LIError. git-svn-id: svn://svn.cc65.org/cc65/trunk@3961 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/error.c b/src/cc65/error.c index 2877ba4f4..9a41afe98 100644 --- a/src/cc65/error.c +++ b/src/cc65/error.c @@ -96,6 +96,17 @@ void Warning (const char* Format, ...) +void LIWarning (const LineInfo* LI, const char* Format, ...) +/* Print a warning message with the line info given explicitly */ +{ + va_list ap; + va_start (ap, Format); + IntWarning (GetInputName (LI), GetInputLine (LI), Format, ap); + va_end (ap); +} + + + void PPWarning (const char* Format, ...) /* Print warning message. For use within the preprocessor. */ { @@ -136,6 +147,17 @@ void Error (const char* Format, ...) +void LIError (const LineInfo* LI, const char* Format, ...) +/* Print an error message with the line info given explicitly */ +{ + va_list ap; + va_start (ap, Format); + IntError (GetInputName (LI), GetInputLine (LI), Format, ap); + va_end (ap); +} + + + void PPError (const char* Format, ...) /* Print an error message. For use within the preprocessor. */ { diff --git a/src/cc65/error.h b/src/cc65/error.h index cc5ddc733..37b60afa5 100644 --- a/src/cc65/error.h +++ b/src/cc65/error.h @@ -41,6 +41,9 @@ /* common */ #include "attrib.h" +/* cc65 */ +#include "lineinfo.h" + /*****************************************************************************/ @@ -64,12 +67,18 @@ extern unsigned WarningCount; void Warning (const char* Format, ...) attribute ((format (printf, 1, 2))); /* Print warning message. */ +void LIWarning (const LineInfo* LI, const char* Format, ...) attribute ((format (printf, 2, 3))); +/* Print a warning message with the line info given explicitly */ + void PPWarning (const char* Format, ...) attribute ((format (printf, 1, 2))); /* Print warning message. For use within the preprocessor. */ void Error (const char* Format, ...) attribute ((format (printf, 1, 2))); /* Print an error message */ +void LIError (const LineInfo* LI, const char* Format, ...) attribute ((format (printf, 2, 3))); +/* Print an error message with the line info given explicitly */ + void PPError (const char* Format, ...) attribute ((format (printf, 1, 2))); /* Print an error message. For use within the preprocessor. */