summaryrefslogtreecommitdiff
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-09-04 23:45:03 -0700
committerGitHub <noreply@github.com>2018-09-04 23:45:03 -0700
commit5b17d7fccd8f0b4d5030b03924eb00904585ba31 (patch)
tree6e6c0d6fdacf7e03d5d5de0248cf5281880d6031 /Modules/socketmodule.c
parente8ca8806a9f47b3bac4ae1c6b8a54c47d1aad8f3 (diff)
downloadcpython-git-5b17d7fccd8f0b4d5030b03924eb00904585ba31.tar.gz
closes bpo-34581 : Conditionalize use of __pragma in Modules/socketmodule.c. (GH-9067)
(cherry picked from commit 874809ea389e6434787e773a6054a08e0b81f734) Co-authored-by: Erik Janssens <erik.janssens@conceptive.be>
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index ea01a28687..f40bd89e57 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -559,15 +559,18 @@ select_error(void)
# define SET_SOCK_ERROR(err) WSASetLastError(err)
# define SOCK_TIMEOUT_ERR WSAEWOULDBLOCK
# define SOCK_INPROGRESS_ERR WSAEWOULDBLOCK
-# define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996))
#else
# define GET_SOCK_ERROR errno
# define SET_SOCK_ERROR(err) do { errno = err; } while (0)
# define SOCK_TIMEOUT_ERR EWOULDBLOCK
# define SOCK_INPROGRESS_ERR EINPROGRESS
-# define SUPPRESS_DEPRECATED_CALL
#endif
+#ifdef _MSC_VER
+# define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996))
+#else
+# define SUPPRESS_DEPRECATED_CALL
+#endif
#ifdef MS_WINDOWS
/* Does WSASocket() support the WSA_FLAG_NO_HANDLE_INHERIT flag? */