#define _replace_h
#include "config.h"
+
+#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <errno.h>
#if defined(_MSC_VER) || defined(__MINGW32__)
#include "lib/replace/win32/replace.h"
#include <inttypes.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+
#ifndef HAVE_STRERROR
extern char *sys_errlist[];
#define strerror(i) sys_errlist[i]
#endif
#if !defined(HAVE_MKTIME) || !defined(HAVE_TIMEGM)
-#include <sys/time.h>
+#include "system/time.h"
#endif
#ifndef HAVE_MKTIME
int rep_ftruncate(int f,long l);
#endif
-#ifndef HAVE_VASPRINTF_DECL
-#define vasprintf rep_vasprintf
-int rep_vasprintf(char **ptr, const char *format, va_list ap);
-#endif
-
#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
#define bzero(a,b) memset((a),'\0',(b))
#endif
#endif
#endif
-/* add varargs prototypes with printf checking */
-#ifndef HAVE_SNPRINTF_DECL
+#ifndef HAVE_VASPRINTF
+#define vasprintf rep_vasprintf
+int rep_vasprintf(char **ptr, const char *format, va_list ap);
+#endif
+
+#ifndef HAVE_SNPRINTF
#define snprintf rep_snprintf
int rep_snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
#endif
-#ifndef HAVE_ASPRINTF_DECL
+
+#ifndef HAVE_VSNPRINTF
+#define vsnprintf rep_vsnprintf
+int rep_vsnprintf(char *,size_t ,const char *, va_list ap);
+#endif
+
+#ifndef HAVE_ASPRINTF
#define asprintf rep_asprintf
int rep_asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
#endif
#define __STRING(x) #x
#endif
-
-
#endif