summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorErik Janssens <erik.janssens@conceptive.be>2018-09-05 06:29:42 (GMT)
committerBenjamin Peterson <benjamin@python.org>2018-09-05 06:29:42 (GMT)
commit874809ea389e6434787e773a6054a08e0b81f734 (patch)
tree176c6d48c0cebf51ccd2cd56f1cb8dcfededc656 /Modules/socketmodule.c
parent3876af4f7c2ef87db6d2d83efc229955968926dd (diff)
downloadcpython-874809ea389e6434787e773a6054a08e0b81f734.zip
cpython-874809ea389e6434787e773a6054a08e0b81f734.tar.gz
cpython-874809ea389e6434787e773a6054a08e0b81f734.tar.bz2
closes bpo-34581 : Conditionalize use of __pragma in Modules/socketmodule.c. (GH-9067)
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 3a439c4..014f3ba 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? */