diff options
author | Dustin Sallings <dustin@spy.net> | 2009-07-14 23:02:14 -0700 |
---|---|---|
committer | Trond Norbye <Trond.Norbye@sun.com> | 2009-08-19 21:28:34 +0200 |
commit | 891082f349304fb802c3df7491e337b47771eab1 (patch) | |
tree | d67385101a9157a5aaa355b86b1111d60e350bfd /util.h | |
parent | 7db0d07c754d1a54116aa2b424b35b429073b15e (diff) | |
download | memcached-891082f349304fb802c3df7491e337b47771eab1.tar.gz |
vperror implementation
This allows us to provide much more useful error messages for
syscalls.
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -11,3 +11,18 @@ bool safe_strtoull(const char *str, uint64_t *out); bool safe_strtoll(const char *str, int64_t *out); bool safe_strtoul(const char *str, uint32_t *out); bool safe_strtol(const char *str, int32_t *out); + +#ifdef __GCC +# define __gcc_attribute__ __attribute__ +#else +# define __gcc_attribute__(x) +#endif + +/** + * Vararg variant of perror that makes for more useful error messages + * when reporting with parameters. + * + * @param fmt a printf format + */ +void vperror(const char *fmt, ...) + __gcc_attribute__ ((format (printf, 1, 2))); |