aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/errors.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdbsupport/errors.h')
-rw-r--r--gdbsupport/errors.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/gdbsupport/errors.h b/gdbsupport/errors.h
index 9a671d3..5a92578 100644
--- a/gdbsupport/errors.h
+++ b/gdbsupport/errors.h
@@ -48,13 +48,18 @@ extern void verror (const char *fmt, va_list args)
functions do not return. An error message is constructed using
a printf- or vprintf-style argument list. FILE and LINE
indicate the file and line number where the programming error
- was detected. The function "internal_verror" must be provided
+ was detected. Most client code should call the internal_error
+ wrapper macro instead, which expands the source location
+ automatically. The function "internal_verror" must be provided
by the client. */
-extern void internal_error (const char *file, int line,
- const char *fmt, ...)
+extern void internal_error_loc (const char *file, int line,
+ const char *fmt, ...)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 4);
+#define internal_error(fmt, ...) \
+ internal_error_loc (__FILE__, __LINE__, fmt, ##__VA_ARGS__)
+
extern void internal_verror (const char *file, int line,
const char *fmt, va_list args)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (3, 0);
@@ -66,10 +71,13 @@ extern void internal_verror (const char *file, int line,
argument list. The function "internal_vwarning" must be provided
by the client. */
-extern void internal_warning (const char *file, int line,
- const char *fmt, ...)
+extern void internal_warning_loc (const char *file, int line,
+ const char *fmt, ...)
ATTRIBUTE_PRINTF (3, 4);
+#define internal_warning(fmt, ...) \
+ internal_warning_loc (__FILE__, __LINE__, fmt, ##__VA_ARGS__)
+
extern void internal_vwarning (const char *file, int line,
const char *fmt, va_list args)
ATTRIBUTE_PRINTF (3, 0);