curl / Mailing Lists / curl-library / Single Mail

curl-library

RE: Compile errors on update to 7.57.0

From: Per Malmberg <per.malmberg_at_snowsoftware.com>
Date: Tue, 5 Dec 2017 14:46:54 +0000

>>Yes, well but configure already checked if it works to include linux/tcp.h and it deemed it working and hence it defines HAVE_LINUX_TCP_H! :-/
>>The configure header check[*] adds the following set before each include when testing, so maybe one of these makes it work?

Thanks, Daniel.

Adding netinet/in.h as follows does work. Should I make a PR for this?

diff --git a/lib/sendf.c b/lib/sendf.c
index a1cb8e4..027f97c 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -22,6 +22,10 @@

 #include "curl_setup.h"

+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
 #ifdef HAVE_LINUX_TCP_H
 #include <linux/tcp.h>
 #endif
diff --git a/lib/setopt.c b/lib/setopt.c
index 944d173..feb1c68 100644
--- a/lib/setopt.c
+++ b/lib/setopt.c
@@ -26,6 +26,11 @@
 #include <limits.h>
 #endif

+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+
 #ifdef HAVE_LINUX_TCP_H
 #include <linux/tcp.h>
 #endif

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-12-05