Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitadb27ea

Browse files
authored
gh-106320: Remove _PyIsSelectable_fd() C API (#107142)
Move _PyIsSelectable_fd() macro to the internal C API(pycore_fileutils.h).
1 parent956b3de commitadb27ea

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

‎Include/fileobject.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
2929
Py_DEPRECATED(3.12)PyAPI_DATA(int)Py_UTF8Mode;
3030
#endif
3131

32-
/* A routine to check if a file descriptor can be select()-ed. */
33-
#ifdef_MSC_VER
34-
/* On Windows, any socket fd can be select()-ed, no matter how high */
35-
#define_PyIsSelectable_fd(FD) (1)
36-
#else
37-
#define_PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
38-
#endif
39-
4032
#ifndefPy_LIMITED_API
4133
# definePy_CPYTHON_FILEOBJECT_H
4234
# include"cpython/fileobject.h"

‎Include/internal/pycore_fileutils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ extern "C" {
1010

1111
#include<locale.h>/* struct lconv */
1212

13+
/* A routine to check if a file descriptor can be select()-ed. */
14+
#ifdef_MSC_VER
15+
/* On Windows, any socket fd can be select()-ed, no matter how high */
16+
#define_PyIsSelectable_fd(FD) (1)
17+
#else
18+
#define_PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
19+
#endif
1320

1421
struct_fileutils_state {
1522
intforce_ascii;

‎Modules/_ssl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#defineOPENSSL_NO_DEPRECATED 1
2727

2828
#include"Python.h"
29+
#include"pycore_fileutils.h"// _PyIsSelectable_fd()
2930
#include"pycore_weakref.h"// _PyWeakref_GET_REF()
3031

3132
/* Include symbols from _socket module */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp