-rw-r--r-- | rsync/trace.h | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/rsync/trace.h b/rsync/trace.h index 60a6477..2bb8552 100644 --- a/rsync/trace.h +++ b/rsync/trace.h @@ -37,11 +37,13 @@ */ -void rs_fatal0(char const *s, ...); -void rs_error0(char const *s, ...); -void rs_trace0(char const *s, ...); - -void rs_log0_nofn(int level, char const *fmt, ...); - -#ifdef __GNUC__ +#if defined(HAVE_VARARG_MACROS) && defined(__GNUC__) +/* + * TODO: Don't assume this is a gcc thing; rather test in autoconf for + * support for __FUNCTION__. One simple way might just be to try compiling + * the definition of one of these functions! + * + * TODO: Also look for the C9X predefined identifier `_function', or + * whatever it's called. + */ void rs_log0(int level, char const *fn, char const *fmt, ...) @@ -53,16 +55,7 @@ void rs_log0(int level, char const *fn, char const *fmt, ...) } while (0) #else -# define rs_trace(s, str...) +# define rs_trace(fmt, arg...) #endif /* !DO_RS_TRACE */ -/* - * TODO: Don't assume this is a gcc thing; rather test in autoconf for - * support for __FUNCTION__ and varargs macros. One simple way might - * just be to try compiling the definition of one of these functions! - * - * TODO: Also look for the C9X predefined identifier `_function', or - * whatever it's called. - */ - #define rs_log(l, s, str...) do { \ rs_log0((l), __FUNCTION__, (s) , ##str); \ @@ -83,17 +76,15 @@ void rs_log0(int level, char const *fn, char const *fmt, ...) #else /************************* ! __GNUC__ */ - +# define rs_trace rs_trace0 # define rs_fatal rs_fatal0 # define rs_error rs_error0 # define rs_log rs_log0_nofn - -# ifdef DO_RS_TRACE -# define rs_trace rs_trace0 -# endif /* DO_RS_TRACE */ #endif /* ! __GNUC__ */ - +void rs_trace0(char const *s, ...); +void rs_fatal0(char const *s, ...); +void rs_error0(char const *s, ...); void rs_log0(int level, char const *fn, char const *fmt, ...); - +void rs_log0_nofn(int level, char const *fmt, ...); enum { @@ -106,5 +97,4 @@ enum { - /** * \macro rs_trace_enabled() |