aboutsummaryrefslogtreecommitdiff
path: root/lib/config-win32.h
diff options
context:
space:
mode:
authorViktor Szakats <commit@vsz.me>2020-04-04 17:49:20 +0000
committerViktor Szakats <commit@vsz.me>2020-04-04 17:53:15 +0000
commit23a870f2fd041278762ecf819cd1467019588c58 (patch)
tree946c12091003e1978e1a32a805d7e68bdcf19105 /lib/config-win32.h
parent0c511b44ffd9fa93a791d6e16fc9a0076091f5b2 (diff)
windows: enable UnixSockets with all build toolchains
Extend existing unix socket support in Windows builds to be enabled for all toolchain vendors or versions. (Previously it was only supported with certain MSVC versions + more recent Windows 10 SDKs) Ref: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/ Ref: https://github.com/curl/curl/issues/5162 Closes: https://github.com/curl/curl/pull/5170
Diffstat (limited to 'lib/config-win32.h')
-rw-r--r--lib/config-win32.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/config-win32.h b/lib/config-win32.h
index d19665d71..516baca02 100644
--- a/lib/config-win32.h
+++ b/lib/config-win32.h
@@ -719,12 +719,15 @@ Vista
#endif
/* Define to use Unix sockets. */
-#if defined(_MSC_VER) && (_MSC_VER >= 1500)
-/* sdkddkver.h first shipped with Platform SDK v6.0A included with VS2008 */
-#include <sdkddkver.h>
-#if defined(NTDDI_WIN10_RS4)
#define USE_UNIX_SOCKETS
-#endif
+#if !defined(UNIX_PATH_MAX)
+ /* Replicating logic present in afunix.h of newer Windows 10 SDK versions */
+# define UNIX_PATH_MAX 108
+# include <ws2tcpip.h>
+ typedef struct sockaddr_un {
+ ADDRESS_FAMILY sun_family;
+ char sun_path[UNIX_PATH_MAX];
+ } SOCKADDR_UN, *PSOCKADDR_UN;
#endif
/* ---------------------------------------------------------------- */