summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorMike Pape <dotzenlabs@gmail.com>2010-11-04 02:35:11 +0100
committerJunio C Hamano <gitster@pobox.com>2010-11-04 16:53:49 -0700
commitda523cc597b1be7fe61ee870cf93b142e70fab7f (patch)
tree38149dba3a2f29a898352874895bd03f4d79649d /compat
parent088d880247dc7bb1a27f07e320bab7f9b63e06bc (diff)
downloadgit-da523cc597b1be7fe61ee870cf93b142e70fab7f.tar.gz
compat: add inet_pton and inet_ntop prototypes
Windows doesn't have inet_pton and inet_ntop, so add prototypes in git-compat-util.h for them. At the same time include git-compat-util.h in the sources for these functions, so they use the network-wrappers from there on Windows. Signed-off-by: Mike Pape <dotzenlabs@gmail.com> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/inet_ntop.c6
-rw-r--r--compat/inet_pton.c8
2 files changed, 8 insertions, 6 deletions
diff --git a/compat/inet_ntop.c b/compat/inet_ntop.c
index f44498258d..e5b46a0f21 100644
--- a/compat/inet_ntop.c
+++ b/compat/inet_ntop.c
@@ -17,9 +17,9 @@
#include <errno.h>
#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+
+#include "../git-compat-util.h"
+
#include <stdio.h>
#include <string.h>
diff --git a/compat/inet_pton.c b/compat/inet_pton.c
index 4078fc0877..2ec995e63d 100644
--- a/compat/inet_pton.c
+++ b/compat/inet_pton.c
@@ -17,9 +17,9 @@
#include <errno.h>
#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+
+#include "../git-compat-util.h"
+
#include <stdio.h>
#include <string.h>
@@ -41,7 +41,9 @@
*/
static int inet_pton4(const char *src, unsigned char *dst);
+#ifndef NO_IPV6
static int inet_pton6(const char *src, unsigned char *dst);
+#endif
/* int
* inet_pton4(src, dst)