Skip to content

Commit 5b17d7f

Browse files
closes bpo-34581 : Conditionalize use of __pragma in Modules/socketmodule.c. (GH-9067)
(cherry picked from commit 874809e) Co-authored-by: Erik Janssens <[email protected]>
1 parent e8ca880 commit 5b17d7f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Guard MSVC-specific code in socketmodule.c with ``#ifdef _MSC_VER``.

Modules/socketmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,18 @@ select_error(void)
559559
# define SET_SOCK_ERROR(err) WSASetLastError(err)
560560
# define SOCK_TIMEOUT_ERR WSAEWOULDBLOCK
561561
# define SOCK_INPROGRESS_ERR WSAEWOULDBLOCK
562-
# define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996))
563562
#else
564563
# define GET_SOCK_ERROR errno
565564
# define SET_SOCK_ERROR(err) do { errno = err; } while (0)
566565
# define SOCK_TIMEOUT_ERR EWOULDBLOCK
567566
# define SOCK_INPROGRESS_ERR EINPROGRESS
568-
# define SUPPRESS_DEPRECATED_CALL
569567
#endif
570568

569+
#ifdef _MSC_VER
570+
# define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996))
571+
#else
572+
# define SUPPRESS_DEPRECATED_CALL
573+
#endif
571574

572575
#ifdef MS_WINDOWS
573576
/* Does WSASocket() support the WSA_FLAG_NO_HANDLE_INHERIT flag? */

0 commit comments

Comments
 (0)