summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Sintonen <sintonen@iki.fi>2019-10-10 12:52:51 +0300
committerDaniel Stenberg <daniel@haxx.se>2019-10-10 23:20:15 +0200
commit0dc14b83818f6166d60e939ce2cc1c4806d39c4a (patch)
tree4af162e02528727456e14ced5c854fd3538295fc
parent622cf7db6bd2d943e67660020b3984e6068f1084 (diff)
downloadcurl-0dc14b83818f6166d60e939ce2cc1c4806d39c4a.tar.gz
socketpair: fix include and define for older TCP header systems
fixed build for systems that need netinet/in.h for IPPROTO_TCP and are missing INADDR_LOOPBACK Closes #4480
-rw-r--r--lib/socketpair.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/socketpair.c b/lib/socketpair.c
index ffdfdad7f..1f0e2e4a4 100644
--- a/lib/socketpair.c
+++ b/lib/socketpair.c
@@ -37,6 +37,12 @@
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h> /* IPPROTO_TCP */
+#endif
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK 0x7f000001
+#endif /* !INADDR_LOOPBACK */
#endif /* !WIN32 */
/* The last 3 #include files should be in this order */