summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-04-20 09:21:09 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-04-20 09:21:09 +0200
commit71471c7d6c4425d3b691f3a0e4be3bbeccf34b66 (patch)
treea3b5e8918eb9be3f799747ad40dd285098a0e30e
parent6e3f2febcba4e744eb2f78db4905c76e73615c6c (diff)
downloadcurl-bagder/shutdown-flags.tar.gz
curl_setup: provide the shutdown flags widerbagder/shutdown-flags
By using #ifdef on the symbol names to work on anything that don't provide them. Reported-by: Kevin R. Bulgrien Bug: https://curl.se/mail/lib-2021-04/0073.html
-rw-r--r--lib/curl_setup.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index cf1c26a14..b63b9e2d7 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -715,13 +715,19 @@ int netware_init(void);
#endif
/*
- * Portable symbolic names for Winsock shutdown() mode flags.
+ * shutdown() flags for systems that don't define them
*/
-#ifdef USE_WINSOCK
-# define SHUT_RD 0x00
-# define SHUT_WR 0x01
-# define SHUT_RDWR 0x02
+#ifndef SHUT_RD
+#define SHUT_RD 0x00
+#endif
+
+#ifndef SHUT_WR
+#define SHUT_WR 0x01
+#endif
+
+#ifndef SHUT_RDWR
+#define SHUT_RDWR 0x02
#endif
/* Define S_ISREG if not defined by system headers, f.e. MSVC */