Skip to content

Commit

Permalink
windows: enable UnixSockets with all build toolchains
Browse files Browse the repository at this point in the history
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: #5162
Closes: #5170
  • Loading branch information
vszakats committed Apr 4, 2020
1 parent 0c511b4 commit 23a870f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 8 additions & 5 deletions lib/config-win32.h
Expand Up @@ -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

/* ---------------------------------------------------------------- */
Expand Down
6 changes: 1 addition & 5 deletions lib/curl_addrinfo.c
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -50,10 +50,6 @@
# define in_addr_t unsigned long
#endif

#if defined(WIN32) && defined(USE_UNIX_SOCKETS)
#include <afunix.h>
#endif

#include <stddef.h>

#include "curl_addrinfo.h"
Expand Down

0 comments on commit 23a870f

Please sign in to comment.