mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
This is roughly socket2.diff from issue 1378, with a few changes applied
to ssl.py (no need to test whether we can dup any more). Regular sockets no longer have a _base, but we still have explicit reference counting of socket objects for the benefit of makefile(); using duplicate sockets won't work for SSLSocket.
This commit is contained in:
parent
dd9e3b8736
commit
39eb8fa0db
5 changed files with 126 additions and 118 deletions
|
@ -26,6 +26,15 @@ PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *);
|
|||
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
|
||||
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
|
||||
|
||||
/* Used by socketmodule.c */
|
||||
#if SIZEOF_SOCKET_T <= SIZEOF_LONG
|
||||
#define PyLong_FromSocket_t(fd) PyLong_FromLong((SOCKET_T)(fd))
|
||||
#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLong(fd)
|
||||
#else
|
||||
#define PyLong_FromSocket_t(fd) PyLong_FromLongLong(((SOCKET_T)(fd));
|
||||
#define PyLong_AsSocket_t(fd) (SOCKET_T)PyLong_AsLongLong(fd)
|
||||
#endif
|
||||
|
||||
/* For use by intobject.c only */
|
||||
PyAPI_DATA(int) _PyLong_DigitValue[256];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue