r18129: moved the system includes into libreplace - this gives much more
[jelmer/samba4-debian.git] / source / lib / replace / replace.h
index 631488bbf87eaf606ae3825ffaf6ec8cdc8e07eb..38b4e08704ac94cc28b669780613b37baa1a5173 100644 (file)
 #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]
@@ -70,7 +82,7 @@ void *rep_memmove(void *dest,const void *src,int size);
 #endif
 
 #if !defined(HAVE_MKTIME) || !defined(HAVE_TIMEGM)
-#include <sys/time.h>
+#include "system/time.h"
 #endif
 
 #ifndef HAVE_MKTIME
@@ -139,11 +151,6 @@ unsigned long long int rep_strtoull(const char *str, char **endptr, int base);
 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
@@ -161,12 +168,22 @@ int rep_vasprintf(char **ptr, const char *format, va_list ap);
 #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
@@ -281,6 +298,4 @@ typedef int bool;
 #define __STRING(x)    #x
 #endif
 
-
-
 #endif