From 31f2a419764a8ba77c2a970cfc80056c6cd06756 Mon Sep 17 00:00:00 2001 From: shadchin Date: Mon, 12 Feb 2024 07:53:52 +0300 Subject: Update Python from 3.11.8 to 3.12.2 --- contrib/tools/python3/src/Modules/socketmodule.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'contrib/tools/python3/src/Modules/socketmodule.h') diff --git a/contrib/tools/python3/src/Modules/socketmodule.h b/contrib/tools/python3/src/Modules/socketmodule.h index 8df3fef1915..7d4d7d32e9b 100644 --- a/contrib/tools/python3/src/Modules/socketmodule.h +++ b/contrib/tools/python3/src/Modules/socketmodule.h @@ -76,6 +76,15 @@ struct SOCKADDR_BTH_REDEF { # else typedef int socklen_t; # endif /* IPPROTO_IPV6 */ + +/* Remove ifdef once Py_WINVER >= 0x0604 + * socket.h only defines AF_HYPERV if _WIN32_WINNT is at that level or higher + * so for now it's just manually defined. + */ +# ifndef AF_HYPERV +# define AF_HYPERV 34 +# endif +# include #endif /* MS_WINDOWS */ #ifdef HAVE_SYS_UN_H @@ -240,6 +249,11 @@ typedef int SOCKET_T; #define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd) #endif +// AF_HYPERV is only supported on Windows +#if defined(AF_HYPERV) && defined(MS_WINDOWS) +# define HAVE_AF_HYPERV +#endif + /* Socket address */ typedef union sock_addr { struct sockaddr_in in; @@ -288,6 +302,9 @@ typedef union sock_addr { #ifdef HAVE_LINUX_TIPC_H struct sockaddr_tipc tipc; #endif +#ifdef HAVE_AF_HYPERV + SOCKADDR_HV hv; +#endif } sock_addr_t; /* The object holding a socket. It holds some extra information, @@ -305,6 +322,7 @@ typedef struct { sets a Python exception */ _PyTime_t sock_timeout; /* Operation timeout in seconds; 0.0 means non-blocking */ + struct _socket_state *state; } PySocketSockObject; /* --- C API ----------------------------------------------------*/ -- cgit v1.3 From 9962b12542ab8f1c7b8c9e5e913fd07a9e4c7d97 Mon Sep 17 00:00:00 2001 From: thegeorg Date: Tue, 13 Feb 2024 11:41:28 +0300 Subject: Disable unused bluetooth/ includes --- contrib/tools/python3/src/Modules/socketmodule.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'contrib/tools/python3/src/Modules/socketmodule.h') diff --git a/contrib/tools/python3/src/Modules/socketmodule.h b/contrib/tools/python3/src/Modules/socketmodule.h index 7d4d7d32e9b..d55c02fd156 100644 --- a/contrib/tools/python3/src/Modules/socketmodule.h +++ b/contrib/tools/python3/src/Modules/socketmodule.h @@ -112,15 +112,15 @@ typedef int socklen_t; #endif #ifdef HAVE_BLUETOOTH_BLUETOOTH_H -#include -#include -#include -#include -#include +#error #include +#error #include +#error #include +#error #include +#error #include #endif #ifdef HAVE_BLUETOOTH_H -#include +#error #include #endif #ifdef HAVE_NET_IF_H -- cgit v1.3