diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bltinmodule.c | 5 | ||||
-rw-r--r-- | Python/bootstrap_hash.c | 14 | ||||
-rw-r--r-- | Python/fileutils.c | 13 | ||||
-rw-r--r-- | Python/frozenmain.c | 6 | ||||
-rw-r--r-- | Python/pylifecycle.c | 3 | ||||
-rw-r--r-- | Python/sysmodule.c | 4 | ||||
-rw-r--r-- | Python/traceback.c | 7 |
7 files changed, 38 insertions, 14 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 69056bf..c373585 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -17,6 +17,11 @@ #include "clinic/bltinmodule.c.h" +#ifdef HAVE_UNISTD_H +# include <unistd.h> // isatty() +#endif + + static PyObject* update_bases(PyObject *bases, PyObject *const *args, Py_ssize_t nargs) { diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c index ef693e5..86a1691 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -4,22 +4,28 @@ #include "pycore_pylifecycle.h" // _PyOS_URandomNonblock() #include "pycore_runtime.h" // _PyRuntime +#undef HAVE_GETRANDOM +#undef HAVE_GETENTROPY + +#ifdef HAVE_UNISTD_H +# include <unistd.h> // close() +#endif #ifdef MS_WINDOWS # include <windows.h> # include <bcrypt.h> #else -# include <fcntl.h> +# include <fcntl.h> // O_RDONLY # ifdef HAVE_SYS_STAT_H # include <sys/stat.h> # endif # ifdef HAVE_LINUX_RANDOM_H -# include <linux/random.h> +# include <linux/random.h> // GRND_NONBLOCK # endif # if defined(HAVE_SYS_RANDOM_H) && (defined(HAVE_GETRANDOM) || defined(HAVE_GETENTROPY)) -# include <sys/random.h> +# include <sys/random.h> // getrandom() # endif # if !defined(HAVE_GETRANDOM) && defined(HAVE_GETRANDOM_SYSCALL) -# include <sys/syscall.h> +# include <sys/syscall.h> // SYS_getrandom # endif #endif diff --git a/Python/fileutils.c b/Python/fileutils.c index 9bc1de2..17a4ae5 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -2,8 +2,11 @@ #include "pycore_fileutils.h" // fileutils definitions #include "pycore_runtime.h" // _PyRuntime #include "osdefs.h" // SEP -#include <locale.h> + #include <stdlib.h> // mbstowcs() +#ifdef HAVE_UNISTD_H +# include <unistd.h> // getcwd() +#endif #ifdef MS_WINDOWS # include <malloc.h> @@ -19,7 +22,7 @@ extern int winerror_to_errno(int); #endif #ifdef HAVE_LANGINFO_H -#include <langinfo.h> +# include <langinfo.h> // nl_langinfo(CODESET) #endif #ifdef HAVE_SYS_IOCTL_H @@ -27,12 +30,12 @@ extern int winerror_to_errno(int); #endif #ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION -#include <iconv.h> +# include <iconv.h> // iconv_open() #endif #ifdef HAVE_FCNTL_H -#include <fcntl.h> -#endif /* HAVE_FCNTL_H */ +# include <fcntl.h> // fcntl(F_GETFD) +#endif #ifdef O_CLOEXEC /* Does open() support the O_CLOEXEC flag? Possible values: diff --git a/Python/frozenmain.c b/Python/frozenmain.c index 767f980..3ce9476 100644 --- a/Python/frozenmain.c +++ b/Python/frozenmain.c @@ -3,7 +3,11 @@ #include "Python.h" #include "pycore_pystate.h" // _Py_GetConfig() #include "pycore_runtime.h" // _PyRuntime_Initialize() -#include <locale.h> + +#ifdef HAVE_UNISTD_H +# include <unistd.h> // isatty() +#endif + #ifdef MS_WINDOWS extern void PyWinFreeze_ExeInit(void); diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 23f66ec..f3ed77e 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -37,6 +37,9 @@ #include <locale.h> // setlocale() #include <stdlib.h> // getenv() +#ifdef HAVE_UNISTD_H +# include <unistd.h> // isatty() +#endif #if defined(__APPLE__) # include <mach-o/loader.h> diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 7ba7be1..b003017 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -40,7 +40,9 @@ Data members: #include "osdefs.h" // DELIM #include "stdlib_module_names.h" // _Py_stdlib_module_names -#include <locale.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> // getpid() +#endif #ifdef MS_WINDOWS # define WIN32_LEAN_AND_MEAN diff --git a/Python/traceback.c b/Python/traceback.c index 7e791d0..5de1bff 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -20,13 +20,14 @@ #include "frameobject.h" // PyFrame_New() #include "osdefs.h" // SEP -#ifdef HAVE_FCNTL_H -# include <fcntl.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> // lseek() #endif -#define OFF(x) offsetof(PyTracebackObject, x) +#define OFF(x) offsetof(PyTracebackObject, x) #define PUTS(fd, str) (void)_Py_write_noraise(fd, str, (int)strlen(str)) + #define MAX_STRING_LENGTH 500 #define MAX_FRAME_DEPTH 100 #define MAX_NTHREADS 100 |