summaryrefslogtreecommitdiff
path: root/source3/lib/replace
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/replace')
-rw-r--r--source3/lib/replace/replace.h12
-rw-r--r--source3/lib/replace/system/network.h12
2 files changed, 18 insertions, 6 deletions
diff --git a/source3/lib/replace/replace.h b/source3/lib/replace/replace.h
index 907d9b0086..27265e35c4 100644
--- a/source3/lib/replace/replace.h
+++ b/source3/lib/replace/replace.h
@@ -330,18 +330,18 @@ ssize_t rep_pread(int __fd, void *__buf, size_t __nbytes, off_t __offset);
ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset);
#endif
+#if !defined(HAVE_INET_PTON) || !defined(HAVE_INET_NTOP)
+#include "system/network.h"
+#endif
+
#ifndef HAVE_INET_PTON
-#define inet_pton rep_inet_pton
int rep_inet_pton(int af, const char *src, void *dst);
+#define inet_pton rep_inet_pton
#endif
#ifndef HAVE_INET_NTOP
-#define inet_ntop rep_inet_ntop
const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size);
-#endif
-
-#ifndef EAFNOSUPPORT
-#define EAFNOSUPPORT EINVAL
+#define inet_ntop rep_inet_ntop
#endif
#ifdef HAVE_LIMITS_H
diff --git a/source3/lib/replace/system/network.h b/source3/lib/replace/system/network.h
index 7469040b28..70c3ec711c 100644
--- a/source3/lib/replace/system/network.h
+++ b/source3/lib/replace/system/network.h
@@ -106,4 +106,16 @@ char *rep_inet_ntoa(struct in_addr ip);
#define INADDR_NONE 0xffffffff
#endif
+#ifndef EAFNOSUPPORT
+#define EAFNOSUPPORT EINVAL
+#endif
+
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
+
+#ifndef INET6_ADDRSTRLEN
+#define INET6_ADDRSTRLEN 46
+#endif
+
#endif