diff options
author | Jordan Borean <jborean93@gmail.com> | 2022-05-24 20:37:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-24 20:37:06 (GMT) |
commit | fbd11f3edd6d2034774d802e048261e613ffcbf5 (patch) | |
tree | 23a08f9441e5a173240ec392c92be14dda2b0251 /Modules/socketmodule.h | |
parent | 5115a1683154a1f2093aa7f2c6834e47d326cb7d (diff) | |
download | cpython-fbd11f3edd6d2034774d802e048261e613ffcbf5.zip cpython-fbd11f3edd6d2034774d802e048261e613ffcbf5.tar.gz cpython-fbd11f3edd6d2034774d802e048261e613ffcbf5.tar.bz2 |
gh-92658: Add Hyper-V socket support (GH-92755)
Diffstat (limited to 'Modules/socketmodule.h')
-rw-r--r-- | Modules/socketmodule.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h index 1b35b11..66d9ccf 100644 --- a/Modules/socketmodule.h +++ b/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 <hvsocket.h> #endif /* MS_WINDOWS */ #ifdef HAVE_SYS_UN_H @@ -288,6 +297,9 @@ typedef union sock_addr { #ifdef HAVE_LINUX_TIPC_H struct sockaddr_tipc tipc; #endif +#ifdef AF_HYPERV + SOCKADDR_HV hv; +#endif } sock_addr_t; /* The object holding a socket. It holds some extra information, |