mirror of https://github.com/python/cpython
gh-106320: Remove _PyIsSelectable_fd() C API (#107142)
Move _PyIsSelectable_fd() macro to the internal C API (pycore_fileutils.h).
This commit is contained in:
parent
956b3de816
commit
adb27ea2d5
|
@ -29,14 +29,6 @@ Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
|
||||||
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_UTF8Mode;
|
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_UTF8Mode;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* A routine to check if a file descriptor can be select()-ed. */
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
/* On Windows, any socket fd can be select()-ed, no matter how high */
|
|
||||||
#define _PyIsSelectable_fd(FD) (1)
|
|
||||||
#else
|
|
||||||
#define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef Py_LIMITED_API
|
#ifndef Py_LIMITED_API
|
||||||
# define Py_CPYTHON_FILEOBJECT_H
|
# define Py_CPYTHON_FILEOBJECT_H
|
||||||
# include "cpython/fileobject.h"
|
# include "cpython/fileobject.h"
|
||||||
|
|
|
@ -10,6 +10,13 @@ extern "C" {
|
||||||
|
|
||||||
#include <locale.h> /* struct lconv */
|
#include <locale.h> /* struct lconv */
|
||||||
|
|
||||||
|
/* A routine to check if a file descriptor can be select()-ed. */
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
/* On Windows, any socket fd can be select()-ed, no matter how high */
|
||||||
|
#define _PyIsSelectable_fd(FD) (1)
|
||||||
|
#else
|
||||||
|
#define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _fileutils_state {
|
struct _fileutils_state {
|
||||||
int force_ascii;
|
int force_ascii;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#define OPENSSL_NO_DEPRECATED 1
|
#define OPENSSL_NO_DEPRECATED 1
|
||||||
|
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
#include "pycore_fileutils.h" // _PyIsSelectable_fd()
|
||||||
#include "pycore_weakref.h" // _PyWeakref_GET_REF()
|
#include "pycore_weakref.h" // _PyWeakref_GET_REF()
|
||||||
|
|
||||||
/* Include symbols from _socket module */
|
/* Include symbols from _socket module */
|
||||||
|
|
Loading…
Reference in New Issue