From 9775d6ab66dc59e05f0daa4f6048d24bc7989602 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 9 Nov 2006 01:26:27 +0000 Subject: - Define snprintf() when needed. - Improved the compatibility of the standard includes. --- popt/system.h | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'popt') diff --git a/popt/system.h b/popt/system.h index db63dd4b..6f496ed5 100644 --- a/popt/system.h +++ b/popt/system.h @@ -22,11 +22,28 @@ extern __const __int32_t *__ctype_toupper; #endif #include -#include -#include - -#if HAVE_UNISTD_H -#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include #endif #ifndef __GNUC__ @@ -97,6 +114,11 @@ size_t strlcpy(char *d, const char *s, size_t bufsize); size_t strlcat(char *d, const char *s, size_t bufsize); #endif +#if !defined HAVE_SNPRINTF || !defined HAVE_C99_VSNPRINTF +#define snprintf rsync_snprintf +int snprintf(char *str,size_t count,const char *fmt,...); +#endif + #define UNUSED(x) x __attribute__((__unused__)) #define PACKAGE "rsync" -- cgit v1.2.3