@@ -716,12 +716,6 @@ select_error(void)
716
716
# define SOCK_INPROGRESS_ERR EINPROGRESS
717
717
#endif
718
718
719
- #ifdef _MSC_VER
720
- # define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996))
721
- #else
722
- # define SUPPRESS_DEPRECATED_CALL
723
- #endif
724
-
725
719
/* Convenience function to raise an error according to errno
726
720
and return a NULL pointer from a function. */
727
721
@@ -3366,7 +3360,7 @@ sock_setsockopt(PyObject *self, PyObject *args)
3366
3360
& level , & optname , & flag )) {
3367
3361
#ifdef MS_WINDOWS
3368
3362
if (optname == SIO_TCP_SET_ACK_FREQUENCY ) {
3369
- int dummy ;
3363
+ DWORD dummy ;
3370
3364
res = WSAIoctl (get_sock_fd (s ), SIO_TCP_SET_ACK_FREQUENCY , & flag ,
3371
3365
sizeof (flag ), NULL , 0 , & dummy , NULL , NULL );
3372
3366
if (res >= 0 ) {
@@ -6195,8 +6189,10 @@ socket_gethostbyname_ex(PyObject *self, PyObject *args)
6195
6189
#ifdef USE_GETHOSTBYNAME_LOCK
6196
6190
PyThread_acquire_lock (netdb_lock , 1 );
6197
6191
#endif
6198
- SUPPRESS_DEPRECATED_CALL
6192
+ _Py_COMP_DIAG_PUSH
6193
+ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
6199
6194
h = gethostbyname (name );
6195
+ _Py_COMP_DIAG_POP
6200
6196
#endif /* HAVE_GETHOSTBYNAME_R */
6201
6197
Py_END_ALLOW_THREADS
6202
6198
/* Some C libraries would require addr.__ss_family instead of
@@ -6300,8 +6296,10 @@ socket_gethostbyaddr(PyObject *self, PyObject *args)
6300
6296
#ifdef USE_GETHOSTBYNAME_LOCK
6301
6297
PyThread_acquire_lock (netdb_lock , 1 );
6302
6298
#endif
6303
- SUPPRESS_DEPRECATED_CALL
6299
+ _Py_COMP_DIAG_PUSH
6300
+ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
6304
6301
h = gethostbyaddr (ap , al , af );
6302
+ _Py_COMP_DIAG_POP
6305
6303
#endif /* HAVE_GETHOSTBYNAME_R */
6306
6304
Py_END_ALLOW_THREADS
6307
6305
ret = gethost_common (state , h , SAS2SA (& addr ), sizeof (addr ), af );
@@ -6718,8 +6716,10 @@ _socket_inet_aton_impl(PyObject *module, const char *ip_addr)
6718
6716
packed_addr = INADDR_BROADCAST ;
6719
6717
} else {
6720
6718
6721
- SUPPRESS_DEPRECATED_CALL
6719
+ _Py_COMP_DIAG_PUSH
6720
+ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
6722
6721
packed_addr = inet_addr (ip_addr );
6722
+ _Py_COMP_DIAG_POP
6723
6723
6724
6724
if (packed_addr == INADDR_NONE ) { /* invalid address */
6725
6725
PyErr_SetString (PyExc_OSError ,
@@ -6762,8 +6762,10 @@ _socket_inet_ntoa_impl(PyObject *module, Py_buffer *packed_ip)
6762
6762
memcpy (& packed_addr , packed_ip -> buf , packed_ip -> len );
6763
6763
PyBuffer_Release (packed_ip );
6764
6764
6765
- SUPPRESS_DEPRECATED_CALL
6765
+ _Py_COMP_DIAG_PUSH
6766
+ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
6766
6767
return PyUnicode_FromString (inet_ntoa (packed_addr ));
6768
+ _Py_COMP_DIAG_POP
6767
6769
}
6768
6770
#endif // HAVE_INET_NTOA
6769
6771
0 commit comments