mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
closes bpo-34581 : Conditionalize use of __pragma in Modules/socketmodule.c. (GH-9067)
This commit is contained in:
parent
3876af4f7c
commit
874809ea38
2 changed files with 6 additions and 2 deletions
|
@ -0,0 +1 @@
|
||||||
|
Guard MSVC-specific code in socketmodule.c with ``#ifdef _MSC_VER``.
|
|
@ -559,15 +559,18 @@ select_error(void)
|
||||||
# define SET_SOCK_ERROR(err) WSASetLastError(err)
|
# define SET_SOCK_ERROR(err) WSASetLastError(err)
|
||||||
# define SOCK_TIMEOUT_ERR WSAEWOULDBLOCK
|
# define SOCK_TIMEOUT_ERR WSAEWOULDBLOCK
|
||||||
# define SOCK_INPROGRESS_ERR WSAEWOULDBLOCK
|
# define SOCK_INPROGRESS_ERR WSAEWOULDBLOCK
|
||||||
# define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996))
|
|
||||||
#else
|
#else
|
||||||
# define GET_SOCK_ERROR errno
|
# define GET_SOCK_ERROR errno
|
||||||
# define SET_SOCK_ERROR(err) do { errno = err; } while (0)
|
# define SET_SOCK_ERROR(err) do { errno = err; } while (0)
|
||||||
# define SOCK_TIMEOUT_ERR EWOULDBLOCK
|
# define SOCK_TIMEOUT_ERR EWOULDBLOCK
|
||||||
# define SOCK_INPROGRESS_ERR EINPROGRESS
|
# define SOCK_INPROGRESS_ERR EINPROGRESS
|
||||||
# define SUPPRESS_DEPRECATED_CALL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996))
|
||||||
|
#else
|
||||||
|
# define SUPPRESS_DEPRECATED_CALL
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
/* Does WSASocket() support the WSA_FLAG_NO_HANDLE_INHERIT flag? */
|
/* Does WSASocket() support the WSA_FLAG_NO_HANDLE_INHERIT flag? */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue