]> granicus.if.org Git - curl/commitdiff
socketpair: fix include and define for older TCP header systems
authorHarry Sintonen <sintonen@iki.fi>
Thu, 10 Oct 2019 09:52:51 +0000 (12:52 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 10 Oct 2019 21:20:15 +0000 (23:20 +0200)
fixed build for systems that need netinet/in.h for IPPROTO_TCP and are
missing INADDR_LOOPBACK

Closes #4480

lib/socketpair.c

index ffdfdad7f33865f54c242fe776e31ab2face04d1..1f0e2e4a4f0e46c3bb03e63329d83a188ac1ebff 100644 (file)
 #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 */