summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 088d880)
raw | patch | inline | side by side (parent: 088d880)
author | Mike Pape <dotzenlabs@gmail.com> | |
Thu, 4 Nov 2010 01:35:11 +0000 (02:35 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 4 Nov 2010 23:53:49 +0000 (16:53 -0700) |
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>
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>
Makefile | patch | blob | history | |
compat/inet_ntop.c | patch | blob | history | |
compat/inet_pton.c | patch | blob | history | |
git-compat-util.h | patch | blob | history |
diff --git a/Makefile b/Makefile
index d9d941933c401d7489fbb71533a1604999b75151..2aa067aaf491986bb5ee8dece92796e41bbf4f34 100644 (file)
--- a/Makefile
+++ b/Makefile
endif
ifdef NO_INET_NTOP
LIB_OBJS += compat/inet_ntop.o
+ BASIC_CFLAGS += -DNO_INET_NTOP
endif
ifdef NO_INET_PTON
LIB_OBJS += compat/inet_pton.o
+ BASIC_CFLAGS += -DNO_INET_PTON
endif
ifdef NO_ICONV
diff --git a/compat/inet_ntop.c b/compat/inet_ntop.c
index f44498258d4c2a0ebd1379ed818d9d04b56f0761..e5b46a0f21344178acf9ad47542765049ad4a0b9 100644 (file)
--- a/compat/inet_ntop.c
+++ b/compat/inet_ntop.c
#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 4078fc0877ca99c82152acdd6b7a9eef70a9f8a4..2ec995e63d0cdef6dcd8b2fd6ea7aa544f4d1b33 100644 (file)
--- a/compat/inet_pton.c
+++ b/compat/inet_pton.c
#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>
*/
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)
diff --git a/git-compat-util.h b/git-compat-util.h
index e192831961cb50b6e1421773e74dcd70fb2dce97..56dce8588472e8535c1482ed21818f413abb4dbf 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
}
#endif
+#ifdef NO_INET_PTON
+int inet_pton(int af, const char *src, void *dst);
+#endif
+
+#ifdef NO_INET_NTOP
+const char *inet_ntop(int af, const void *src, char *dst, size_t size);
+#endif
+
extern void release_pack_memory(size_t, int);
typedef void (*try_to_free_t)(size_t);