bpo-45434: pyport.h no longer includes <stdlib.h> (GH-28914)

Include <stdlib.h> explicitly in C files.

Python.h includes <wchar.h>.
This commit is contained in:
Victor Stinner 2021-10-13 19:25:53 +02:00 committed by GitHub
parent db2b6a20cd
commit aac29af678
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 61 additions and 21 deletions

View file

@ -119,6 +119,7 @@
#include "Python.h"
#include "pycore_dtoa.h"
#include <stdlib.h> // exit()
/* if PY_NO_SHORT_FLOAT_REPR is defined, then don't even try to compile
the following code */

View file

@ -15,12 +15,13 @@ extern char *strerror(int);
#endif
#endif
#include <ctype.h>
#ifdef MS_WINDOWS
#include <windows.h>
#include <winbase.h>
# include <windows.h>
# include <winbase.h>
# include <stdlib.h> // _sys_nerr
#endif
#include <ctype.h>
#ifdef __cplusplus
extern "C" {

View file

@ -3,6 +3,7 @@
#include "pycore_runtime.h" // _PyRuntime
#include "osdefs.h" // SEP
#include <locale.h>
#include <stdlib.h> // mbstowcs()
#ifdef MS_WINDOWS
# include <malloc.h>

View file

@ -10,7 +10,9 @@
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "osdefs.h" // DELIM
#include <locale.h> // setlocale()
#include <stdlib.h> // getenv()
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
# ifdef HAVE_IO_H
# include <io.h>

View file

@ -4,7 +4,9 @@
#include "pycore_initconfig.h" // _PyArgv
#include "pycore_pymem.h" // _PyMem_GetAllocatorName()
#include "pycore_runtime.h" // _PyRuntime_Initialize()
#include <locale.h> // setlocale()
#include <stdlib.h> // getenv()
/* Forward declarations */

View file

@ -16,6 +16,7 @@
#include "pycore_traceback.h" // _Py_DumpTracebackThreads()
#include <locale.h> // setlocale()
#include <stdlib.h> // getenv()
#if defined(__APPLE__)
#include <mach-o/loader.h>

View file

@ -1,8 +1,8 @@
/* Format bytes as hexadecimal */
#include "Python.h"
#include "pycore_strhex.h" // _Py_strhex_with_sep()
#include "pycore_strhex.h" // _Py_strhex_with_sep()
#include <stdlib.h> // abs()
static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
const PyObject* sep, int bytes_per_sep_group,