From: Viktor Szakats Date: Mon, 3 Aug 2020 14:27:27 +0000 (+0000) Subject: windows: disable Unix Sockets for old mingw X-Git-Tag: curl-7_72_0~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8297978c21646588711000c20aa3f7eaef677e03;p=thirdparty%2Fcurl.git windows: disable Unix Sockets for old mingw Classic mingw and 10y+ old versions of mingw-w64 don't ship with Windows headers having the typedef necessary for Unix Sockets support, so try detecting these environments to disable this feature. Ref: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/cf6afc57179a5910621215f8f4037d406892072c/ Reviewed-by: Daniel Stenberg Fixes #5674 Closes #5758 --- diff --git a/lib/config-win32.h b/lib/config-win32.h index 76ee6b1a77..316043d817 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -718,18 +718,22 @@ Vista #define USE_WIN32_CRYPTO #endif +/* On MinGW the ADDRESS_FAMILY typedef was committed alongside LUP_SECURE, + so we use it to check for the presence of the typedef. */ +#include +#if !defined(__MINGW32__) || defined(LUP_SECURE) /* Define to use Unix sockets. */ #define USE_UNIX_SOCKETS #if !defined(UNIX_PATH_MAX) /* Replicating logic present in afunix.h of newer Windows 10 SDK versions */ # define UNIX_PATH_MAX 108 -# include /* !checksrc! disable TYPEDEFSTRUCT 1 */ typedef struct sockaddr_un { ADDRESS_FAMILY sun_family; char sun_path[UNIX_PATH_MAX]; } SOCKADDR_UN, *PSOCKADDR_UN; #endif +#endif /* ---------------------------------------------------------------- */ /* ADDITIONAL DEFINITIONS */