mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-92658: AF_HYPERV is only supported on Windows (#93192)
Only build the AF_HYPERV support on Windows for the _socket extension. FreeBSD defines the AF_HYPERV macro but doesn't have the SOCKADDR_HV type.
This commit is contained in:
parent
ac1dcb8ee7
commit
08e4e887f2
2 changed files with 13 additions and 8 deletions
|
|
@ -249,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;
|
||||
|
|
@ -297,7 +302,7 @@ typedef union sock_addr {
|
|||
#ifdef HAVE_LINUX_TIPC_H
|
||||
struct sockaddr_tipc tipc;
|
||||
#endif
|
||||
#ifdef AF_HYPERV
|
||||
#ifdef HAVE_AF_HYPERV
|
||||
SOCKADDR_HV hv;
|
||||
#endif
|
||||
} sock_addr_t;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue