diff options
author | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 15:39:38 -0800 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 15:39:38 -0800 |
commit | 1a5780aabb550cae175ad8711e2f33ba644d0ddb (patch) | |
tree | 68e47eaafb4ccc17bbdb7668c6058984945b332d /Include/fileutils.h | |
parent | 956c7cfa7111ab5458e2f69868a05b7b84fc6843 (diff) | |
parent | d1d8706cdb77e2adbbb4110338dcda0e1811f892 (diff) | |
download | cpython-1a5780aabb550cae175ad8711e2f33ba644d0ddb.tar.gz |
Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0].
Diffstat (limited to 'Include/fileutils.h')
-rw-r--r-- | Include/fileutils.h | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/Include/fileutils.h b/Include/fileutils.h index b4a683c176..b933e98539 100644 --- a/Include/fileutils.h +++ b/Include/fileutils.h @@ -5,8 +5,7 @@ extern "C" { #endif -PyAPI_FUNC(PyObject *) _Py_device_encoding(int); - +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 PyAPI_FUNC(wchar_t *) Py_DecodeLocale( const char *arg, size_t *size); @@ -14,9 +13,12 @@ PyAPI_FUNC(wchar_t *) Py_DecodeLocale( PyAPI_FUNC(char*) Py_EncodeLocale( const wchar_t *text, size_t *error_pos); +#endif #ifndef Py_LIMITED_API +PyAPI_FUNC(PyObject *) _Py_device_encoding(int); + #ifdef MS_WINDOWS struct _Py_stat_struct { unsigned long st_dev; @@ -46,13 +48,11 @@ PyAPI_FUNC(int) _Py_fstat( PyAPI_FUNC(int) _Py_fstat_noraise( int fd, struct _Py_stat_struct *status); -#endif /* Py_LIMITED_API */ PyAPI_FUNC(int) _Py_stat( PyObject *path, struct stat *status); -#ifndef Py_LIMITED_API PyAPI_FUNC(int) _Py_open( const char *pathname, int flags); @@ -60,7 +60,6 @@ PyAPI_FUNC(int) _Py_open( PyAPI_FUNC(int) _Py_open_noraise( const char *pathname, int flags); -#endif PyAPI_FUNC(FILE *) _Py_wfopen( const wchar_t *path, @@ -107,7 +106,6 @@ PyAPI_FUNC(wchar_t*) _Py_wgetcwd( wchar_t *buf, size_t size); -#ifndef Py_LIMITED_API PyAPI_FUNC(int) _Py_get_inheritable(int fd); PyAPI_FUNC(int) _Py_set_inheritable(int fd, int inheritable, @@ -121,18 +119,6 @@ PyAPI_FUNC(int) _Py_get_blocking(int fd); PyAPI_FUNC(int) _Py_set_blocking(int fd, int blocking); #endif /* !MS_WINDOWS */ -#if defined _MSC_VER && _MSC_VER >= 1400 && _MSC_VER < 1900 -/* A routine to check if a file descriptor is valid on Windows. Returns 0 - * and sets errno to EBADF if it isn't. This is to avoid Assertions - * from various functions in the Windows CRT beginning with - * Visual Studio 2005 - */ -int _PyVerify_fd(int fd); - -#else -#define _PyVerify_fd(A) (1) /* dummy */ -#endif - #endif /* Py_LIMITED_API */ #ifdef __cplusplus |