aboutsummaryrefslogtreecommitdiff
path: root/src/include/k5-err.h
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-04-29 23:21:21 +0000
committerGreg Hudson <ghudson@mit.edu>2009-04-29 23:21:21 +0000
commit41d6e61e7a953d6ef5e77a3271208b1b6c4e4921 (patch)
tree7dbf3d53b8a58345edf9ae044f3f73dce5b6737d /src/include/k5-err.h
parent16aaf27414aaf5478b774e4c504128ef38faa307 (diff)
downloadkrb5-41d6e61e7a953d6ef5e77a3271208b1b6c4e4921.zip
krb5-41d6e61e7a953d6ef5e77a3271208b1b6c4e4921.tar.gz
krb5-41d6e61e7a953d6ef5e77a3271208b1b6c4e4921.tar.bz2
Add DEBUG_ERROR_LOCATIONS support
If DEBUG_ERROR_LOCATIONS is defined, replace uses of krb5_set_error_message and krb5int_set_error with calls to the new _fl variants of those functions, and include filename and line number information in the calls. Requires C99-style variadic macros if defined. ticket: 6479 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22291 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include/k5-err.h')
-rw-r--r--src/include/k5-err.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/include/k5-err.h b/src/include/k5-err.h
index a6dedcc..e5fc9bd 100644
--- a/src/include/k5-err.h
+++ b/src/include/k5-err.h
@@ -65,6 +65,22 @@ krb5int_vset_error (struct errinfo *ep, long code,
__attribute__((__format__(__printf__, 3, 0)))
#endif
;
+void
+krb5int_set_error_fl (struct errinfo *ep, long code,
+ const char *file, int line,
+ const char *fmt, ...)
+#if !defined(__cplusplus) && (__GNUC__ > 2)
+ __attribute__((__format__(__printf__, 5, 6)))
+#endif
+ ;
+void
+krb5int_vset_error_fl (struct errinfo *ep, long code,
+ const char *file, int line,
+ const char *fmt, va_list args)
+#if !defined(__cplusplus) && (__GNUC__ > 2)
+ __attribute__((__format__(__printf__, 5, 0)))
+#endif
+ ;
const char *
krb5int_get_error (struct errinfo *ep, long code);
void
@@ -74,4 +90,9 @@ krb5int_clear_error (struct errinfo *ep);
void
krb5int_set_error_info_callout_fn (const char *(KRB5_CALLCONV *f)(long));
+#ifdef DEBUG_ERROR_LOCATIONS
+#define krb5int_set_error(ep, code, ...) \
+ krb5int_set_error_fl(ep, code, __FILE__, __LINE__, __VA_ARGS__)
+#endif
+
#endif /* K5_ERR_H */