diff options
author | Greg Hudson <ghudson@mit.edu> | 2009-04-29 23:21:21 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2009-04-29 23:21:21 +0000 |
commit | 41d6e61e7a953d6ef5e77a3271208b1b6c4e4921 (patch) | |
tree | 7dbf3d53b8a58345edf9ae044f3f73dce5b6737d /src/include/k5-err.h | |
parent | 16aaf27414aaf5478b774e4c504128ef38faa307 (diff) | |
download | krb5-41d6e61e7a953d6ef5e77a3271208b1b6c4e4921.tar.gz krb5-41d6e61e7a953d6ef5e77a3271208b1b6c4e4921.tar.xz krb5-41d6e61e7a953d6ef5e77a3271208b1b6c4e4921.zip |
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.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/include/k5-err.h b/src/include/k5-err.h index a6dedcc88..e5fc9bddf 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 */ |