summaryrefslogtreecommitdiff
path: root/rsync
Side-by-side diff
Diffstat (limited to 'rsync') (more/less context) (ignore whitespace changes)
-rw-r--r--rsync/config_linux.h2
-rw-r--r--rsync/trace.h40
2 files changed, 16 insertions, 26 deletions
diff --git a/rsync/config_linux.h b/rsync/config_linux.h
index e5ff3e4..f488b78 100644
--- a/rsync/config_linux.h
+++ b/rsync/config_linux.h
@@ -1,74 +1,74 @@
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define this if your sockaddr structure contains sin_len */
/* #undef HAVE_SOCK_SIN_LEN */
/* How many bits would you like to have in an off_t? */
#define _FILE_OFFSET_BITS 64
/* Define to include GNU C library extensions. */
#define _GNU_SOURCE 1
/* GNU extension of saving argv[0] to program_invocation_short_name */
-#define HAVE_PROGRAM_INVOCATION_NAME 1
+/* #define HAVE_PROGRAM_INVOCATION_NAME 1 */
/* Define to a replacement type if intmax_t is not a builtin, or in
sys/types.h or stdlib.h or stddef.h */
/* #undef intmax_t */
/* The number of bytes in a int. */
#define SIZEOF_INT 4
/* The number of bytes in a long. */
#define SIZEOF_LONG 4
/* The number of bytes in a off_t. */
#define SIZEOF_OFF_T 8
/* The number of bytes in a short. */
#define SIZEOF_SHORT 2
/* The number of bytes in a size_t. */
#define SIZEOF_SIZE_T 4
/* The number of bytes in a unsigned char. */
#define SIZEOF_UNSIGNED_CHAR 1
/* The number of bytes in a unsigned int. */
#define SIZEOF_UNSIGNED_INT 4
/* The number of bytes in a unsigned long. */
#define SIZEOF_UNSIGNED_LONG 4
/* The number of bytes in a unsigned short. */
#define SIZEOF_UNSIGNED_SHORT 2
/* Define if you have the mtrace function. */
#define HAVE_MTRACE 1
/* Define if you have the snprintf function. */
#define HAVE_SNPRINTF 1
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the vsnprintf function. */
#define HAVE_VSNPRINTF 1
/* Define if you have the <alloca.h> header file. */
#define HAVE_ALLOCA_H 1
/* Define if you have the <bzlib.h> header file. */
diff --git a/rsync/trace.h b/rsync/trace.h
index 60a6477..2bb8552 100644
--- a/rsync/trace.h
+++ b/rsync/trace.h
@@ -1,122 +1,112 @@
/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*-
*
* librsync -- generate and apply network deltas
* $Id$
*
* Copyright (C) 2000, 2001 by Martin Pool <mbp@samba.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* TODO: A function like perror that includes strerror output. Apache
* does this by adding flags as well as the severity level which say
* whether such information should be included.
*/
/*
* trace may be turned off.
*
* error is always on, but you can return and continue in some way
*
* fatal terminates the whole process
*/
-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, ...)
__attribute__ ((format(printf, 3, 4)));
#ifdef DO_RS_TRACE
# define rs_trace(fmt, arg...) \
do { rs_log0(RS_LOG_DEBUG, __FUNCTION__, fmt , ##arg); \
} 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); \
} while (0)
#define rs_error(s, str...) do { \
rs_log0(RS_LOG_ERR, __FUNCTION__, (s) , ##str); \
} while (0)
#define rs_fatal(s, str...) do { \
rs_log0(RS_LOG_CRIT, __FUNCTION__, \
(s) , ##str); \
abort(); \
} while (0)
#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 {
RS_LOG_PRIMASK = 7, /**< Mask to extract priority
part. \internal */
RS_LOG_NONAME = 8 /**< \b Don't show function name in
message. */
};
-
/**
* \macro rs_trace_enabled()
*
* Call this before putting too much effort into generating trace
* messages.
*/
extern int rs_trace_level;
#ifdef DO_RS_TRACE
# define rs_trace_enabled() ((rs_trace_level & RS_LOG_PRIMASK) >= RS_LOG_DEBUG)
#else
# define rs_trace_enabled() 0
#endif