summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-26 01:18:09 (GMT)
committerGitHub <noreply@github.com>2023-08-26 01:18:09 (GMT)
commit6353c21b78a3d91e7cd7810f1c00258a34e85fe7 (patch)
treefdb9e8068ae4f9fd472718cea32dab935b5064a6 /Modules
parent713afb8804666405f29115cf459b591308e3ab54 (diff)
downloadcpython-6353c21b78a3d91e7cd7810f1c00258a34e85fe7.zip
cpython-6353c21b78a3d91e7cd7810f1c00258a34e85fe7.tar.gz
cpython-6353c21b78a3d91e7cd7810f1c00258a34e85fe7.tar.bz2
gh-106320: Remove private _PyLong_FileDescriptor_Converter() (#108503)
Move the private _PyLong converter functions to the internal C API * _PyLong_FileDescriptor_Converter(): moved to pycore_fileutils.h * _PyLong_Size_t_Converter(): moved to pycore_long.h Argument Clinic now emits includes for pycore_fileutils.h and pycore_long.h when these functions are used.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/clinic/_winapi.c.h3
-rw-r--r--Modules/clinic/fcntlmodule.c.h3
-rw-r--r--Modules/clinic/posixmodule.c.h3
-rw-r--r--Modules/clinic/selectmodule.c.h3
-rw-r--r--Modules/clinic/termios.c.h3
-rw-r--r--Modules/fcntlmodule.c4
-rw-r--r--Modules/termios.c4
7 files changed, 18 insertions, 5 deletions
diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h
index 35ac053..c648e68 100644
--- a/Modules/clinic/_winapi.c.h
+++ b/Modules/clinic/_winapi.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_long.h" // _PyLong_Size_t_Converter()
PyDoc_STRVAR(_winapi_Overlapped_GetOverlappedResult__doc__,
"GetOverlappedResult($self, wait, /)\n"
@@ -1478,4 +1479,4 @@ exit:
return return_value;
}
-/*[clinic end generated code: output=ff91ab5cae8961dd input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c7e08927e163ef13 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/fcntlmodule.c.h b/Modules/clinic/fcntlmodule.c.h
index bd978b6..c15f345 100644
--- a/Modules/clinic/fcntlmodule.c.h
+++ b/Modules/clinic/fcntlmodule.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter()
PyDoc_STRVAR(fcntl_fcntl__doc__,
"fcntl($module, fd, cmd, arg=0, /)\n"
@@ -249,4 +250,4 @@ skip_optional:
exit:
return return_value;
}
-/*[clinic end generated code: output=705976d5f53f2272 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5f096e8731fa38be input=a9049054013a1b77]*/
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index ae3c1d6..4b85519 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter()
#include "pycore_long.h" // _PyLong_UnsignedInt_Converter()
PyDoc_STRVAR(os_stat__doc__,
@@ -11991,4 +11992,4 @@ exit:
#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=a08a47b52da6da0b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ff0e50316f4ed71a input=a9049054013a1b77]*/
diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h
index f6b3ea3..69c0f06 100644
--- a/Modules/clinic/selectmodule.c.h
+++ b/Modules/clinic/selectmodule.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter()
#include "pycore_long.h" // _PyLong_UnsignedShort_Converter()
PyDoc_STRVAR(select_select__doc__,
@@ -1310,4 +1311,4 @@ exit:
#ifndef SELECT_KQUEUE_CONTROL_METHODDEF
#define SELECT_KQUEUE_CONTROL_METHODDEF
#endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */
-/*[clinic end generated code: output=a19c29946a931dce input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a215af2157f038c7 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/termios.c.h b/Modules/clinic/termios.c.h
index 4e911aa..44d4107 100644
--- a/Modules/clinic/termios.c.h
+++ b/Modules/clinic/termios.c.h
@@ -7,6 +7,7 @@ preserve
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter()
PyDoc_STRVAR(termios_tcgetattr__doc__,
"tcgetattr($module, fd, /)\n"
@@ -292,4 +293,4 @@ termios_tcsetwinsize(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=4c79a3bf87370275 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=434df4394b596e92 input=a9049054013a1b77]*/
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index e530621..3bf5830 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -1,5 +1,9 @@
/* fcntl module */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#ifdef HAVE_SYS_FILE_H
diff --git a/Modules/termios.c b/Modules/termios.c
index 6b25410..21d3541 100644
--- a/Modules/termios.c
+++ b/Modules/termios.c
@@ -1,5 +1,9 @@
/* termios.c -- POSIX terminal I/O module implementation. */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
/* Apparently, on SGI, termios.h won't define CTRL if _XOPEN_SOURCE