bpo-29585: Define PYTHONFRAMEWORK in PC/pyconfig.h (#2477)
* bpo-29585: Fix PC/pyconfig.h whitespaces Run "make patchcheck". * bpo-29585: Define PYTHONFRAMEWORK in PC/pyconfig.h * site: Fix path separator in _get_path() on Windows
This commit is contained in:
parent
a8f8d5b4bd
commit
b01c574ad6
|
@ -266,7 +266,7 @@ def _get_path(userbase):
|
||||||
version = sys.version_info
|
version = sys.version_info
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
return f'{userbase}/Python{version[0]}{version[1]}/site-packages'
|
return f'{userbase}\\Python{version[0]}{version[1]}\\site-packages'
|
||||||
|
|
||||||
if sys.platform == 'darwin' and sys._framework:
|
if sys.platform == 'darwin' and sys._framework:
|
||||||
return f'{userbase}/lib/python/site-packages'
|
return f'{userbase}/lib/python/site-packages'
|
||||||
|
|
101
PC/pyconfig.h
101
PC/pyconfig.h
|
@ -31,7 +31,7 @@ WIN32 is still required for the locale module.
|
||||||
|
|
||||||
/* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */
|
/* Deprecated USE_DL_EXPORT macro - please use Py_BUILD_CORE */
|
||||||
#ifdef USE_DL_EXPORT
|
#ifdef USE_DL_EXPORT
|
||||||
# define Py_BUILD_CORE
|
# define Py_BUILD_CORE
|
||||||
#endif /* USE_DL_EXPORT */
|
#endif /* USE_DL_EXPORT */
|
||||||
|
|
||||||
/* Visual Studio 2005 introduces deprecation warnings for
|
/* Visual Studio 2005 introduces deprecation warnings for
|
||||||
|
@ -62,13 +62,13 @@ WIN32 is still required for the locale module.
|
||||||
#define HAVE_STRFTIME
|
#define HAVE_STRFTIME
|
||||||
#define DONT_HAVE_SIG_ALARM
|
#define DONT_HAVE_SIG_ALARM
|
||||||
#define DONT_HAVE_SIG_PAUSE
|
#define DONT_HAVE_SIG_PAUSE
|
||||||
#define LONG_BIT 32
|
#define LONG_BIT 32
|
||||||
#define WORD_BIT 32
|
#define WORD_BIT 32
|
||||||
|
|
||||||
#define MS_WIN32 /* only support win32 and greater. */
|
#define MS_WIN32 /* only support win32 and greater. */
|
||||||
#define MS_WINDOWS
|
#define MS_WINDOWS
|
||||||
#ifndef PYTHONPATH
|
#ifndef PYTHONPATH
|
||||||
# define PYTHONPATH L".\\DLLs;.\\lib"
|
# define PYTHONPATH L".\\DLLs;.\\lib"
|
||||||
#endif
|
#endif
|
||||||
#define NT_THREADS
|
#define NT_THREADS
|
||||||
#define WITH_THREAD
|
#define WITH_THREAD
|
||||||
|
@ -90,9 +90,9 @@ WIN32 is still required for the locale module.
|
||||||
* literally in the string.
|
* literally in the string.
|
||||||
*/
|
*/
|
||||||
#define _Py_PASTE_VERSION(SUFFIX) \
|
#define _Py_PASTE_VERSION(SUFFIX) \
|
||||||
("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]")
|
("[MSC v." _Py_STRINGIZE(_MSC_VER) " " SUFFIX "]")
|
||||||
/* e.g., this produces, after compile-time string catenation,
|
/* e.g., this produces, after compile-time string catenation,
|
||||||
* ("[MSC v.1200 32 bit (Intel)]")
|
* ("[MSC v.1200 32 bit (Intel)]")
|
||||||
*
|
*
|
||||||
* _Py_STRINGIZE(_MSC_VER) expands to
|
* _Py_STRINGIZE(_MSC_VER) expands to
|
||||||
* _Py_STRINGIZE1((_MSC_VER)) expands to
|
* _Py_STRINGIZE1((_MSC_VER)) expands to
|
||||||
|
@ -111,7 +111,7 @@ WIN32 is still required for the locale module.
|
||||||
*and* on Win64. For the same reasons, in Python, MS_WIN32 is
|
*and* on Win64. For the same reasons, in Python, MS_WIN32 is
|
||||||
defined on Win32 *and* Win64. Win32 only code must therefore be
|
defined on Win32 *and* Win64. Win32 only code must therefore be
|
||||||
guarded as follows:
|
guarded as follows:
|
||||||
#if defined(MS_WIN32) && !defined(MS_WIN64)
|
#if defined(MS_WIN32) && !defined(MS_WIN64)
|
||||||
Some modules are disabled on Itanium processors, therefore we
|
Some modules are disabled on Itanium processors, therefore we
|
||||||
have MS_WINI64 set for those targets, otherwise MS_WINX64
|
have MS_WINI64 set for those targets, otherwise MS_WINX64
|
||||||
*/
|
*/
|
||||||
|
@ -261,22 +261,22 @@ typedef int pid_t;
|
||||||
/* End of compilers - finish up */
|
/* End of compilers - finish up */
|
||||||
|
|
||||||
#ifndef NO_STDIO_H
|
#ifndef NO_STDIO_H
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* 64 bit ints are usually spelt __int64 unless compiler has overridden */
|
/* 64 bit ints are usually spelt __int64 unless compiler has overridden */
|
||||||
#ifndef PY_LONG_LONG
|
#ifndef PY_LONG_LONG
|
||||||
# define PY_LONG_LONG __int64
|
# define PY_LONG_LONG __int64
|
||||||
# define PY_LLONG_MAX _I64_MAX
|
# define PY_LLONG_MAX _I64_MAX
|
||||||
# define PY_LLONG_MIN _I64_MIN
|
# define PY_LLONG_MIN _I64_MIN
|
||||||
# define PY_ULLONG_MAX _UI64_MAX
|
# define PY_ULLONG_MAX _UI64_MAX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* For Windows the Python core is in a DLL by default. Test
|
/* For Windows the Python core is in a DLL by default. Test
|
||||||
Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
|
Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
|
||||||
#if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED)
|
#if !defined(MS_NO_COREDLL) && !defined(Py_NO_ENABLE_SHARED)
|
||||||
# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
|
# define Py_ENABLE_SHARED 1 /* standard symbol for shared library */
|
||||||
# define MS_COREDLL /* deprecated old symbol */
|
# define MS_COREDLL /* deprecated old symbol */
|
||||||
#endif /* !MS_NO_COREDLL && ... */
|
#endif /* !MS_NO_COREDLL && ... */
|
||||||
|
|
||||||
/* All windows compilers that use this header support __declspec */
|
/* All windows compilers that use this header support __declspec */
|
||||||
|
@ -284,57 +284,57 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
|
||||||
|
|
||||||
/* For an MSVC DLL, we can nominate the .lib files used by extensions */
|
/* For an MSVC DLL, we can nominate the .lib files used by extensions */
|
||||||
#ifdef MS_COREDLL
|
#ifdef MS_COREDLL
|
||||||
# ifndef Py_BUILD_CORE /* not building the core - must be an ext */
|
# ifndef Py_BUILD_CORE /* not building the core - must be an ext */
|
||||||
# if defined(_MSC_VER)
|
# if defined(_MSC_VER)
|
||||||
/* So MSVC users need not specify the .lib file in
|
/* So MSVC users need not specify the .lib file in
|
||||||
their Makefile (other compilers are generally
|
their Makefile (other compilers are generally
|
||||||
taken care of by distutils.) */
|
taken care of by distutils.) */
|
||||||
# if defined(_DEBUG)
|
# if defined(_DEBUG)
|
||||||
# pragma comment(lib,"python37_d.lib")
|
# pragma comment(lib,"python37_d.lib")
|
||||||
# elif defined(Py_LIMITED_API)
|
# elif defined(Py_LIMITED_API)
|
||||||
# pragma comment(lib,"python3.lib")
|
# pragma comment(lib,"python3.lib")
|
||||||
# else
|
# else
|
||||||
# pragma comment(lib,"python37.lib")
|
# pragma comment(lib,"python37.lib")
|
||||||
# endif /* _DEBUG */
|
# endif /* _DEBUG */
|
||||||
# endif /* _MSC_VER */
|
# endif /* _MSC_VER */
|
||||||
# endif /* Py_BUILD_CORE */
|
# endif /* Py_BUILD_CORE */
|
||||||
#endif /* MS_COREDLL */
|
#endif /* MS_COREDLL */
|
||||||
|
|
||||||
#if defined(MS_WIN64)
|
#if defined(MS_WIN64)
|
||||||
/* maintain "win32" sys.platform for backward compatibility of Python code,
|
/* maintain "win32" sys.platform for backward compatibility of Python code,
|
||||||
the Win64 API should be close enough to the Win32 API to make this
|
the Win64 API should be close enough to the Win32 API to make this
|
||||||
preferable */
|
preferable */
|
||||||
# define PLATFORM "win32"
|
# define PLATFORM "win32"
|
||||||
# define SIZEOF_VOID_P 8
|
# define SIZEOF_VOID_P 8
|
||||||
# define SIZEOF_TIME_T 8
|
# define SIZEOF_TIME_T 8
|
||||||
# define SIZEOF_OFF_T 4
|
# define SIZEOF_OFF_T 4
|
||||||
# define SIZEOF_FPOS_T 8
|
# define SIZEOF_FPOS_T 8
|
||||||
# define SIZEOF_HKEY 8
|
# define SIZEOF_HKEY 8
|
||||||
# define SIZEOF_SIZE_T 8
|
# define SIZEOF_SIZE_T 8
|
||||||
/* configure.ac defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG,
|
/* configure.ac defines HAVE_LARGEFILE_SUPPORT iff HAVE_LONG_LONG,
|
||||||
sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t).
|
sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t).
|
||||||
On Win64 the second condition is not true, but if fpos_t replaces off_t
|
On Win64 the second condition is not true, but if fpos_t replaces off_t
|
||||||
then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64
|
then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64
|
||||||
should define this. */
|
should define this. */
|
||||||
# define HAVE_LARGEFILE_SUPPORT
|
# define HAVE_LARGEFILE_SUPPORT
|
||||||
#elif defined(MS_WIN32)
|
#elif defined(MS_WIN32)
|
||||||
# define PLATFORM "win32"
|
# define PLATFORM "win32"
|
||||||
# define HAVE_LARGEFILE_SUPPORT
|
# define HAVE_LARGEFILE_SUPPORT
|
||||||
# define SIZEOF_VOID_P 4
|
# define SIZEOF_VOID_P 4
|
||||||
# define SIZEOF_OFF_T 4
|
# define SIZEOF_OFF_T 4
|
||||||
# define SIZEOF_FPOS_T 8
|
# define SIZEOF_FPOS_T 8
|
||||||
# define SIZEOF_HKEY 4
|
# define SIZEOF_HKEY 4
|
||||||
# define SIZEOF_SIZE_T 4
|
# define SIZEOF_SIZE_T 4
|
||||||
/* MS VS2005 changes time_t to a 64-bit type on all platforms */
|
/* MS VS2005 changes time_t to a 64-bit type on all platforms */
|
||||||
# if defined(_MSC_VER) && _MSC_VER >= 1400
|
# if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||||
# define SIZEOF_TIME_T 8
|
# define SIZEOF_TIME_T 8
|
||||||
# else
|
# else
|
||||||
# define SIZEOF_TIME_T 4
|
# define SIZEOF_TIME_T 4
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
# define Py_DEBUG
|
# define Py_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -690,4 +690,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
|
||||||
/* Define to 1 if you have the `erfc' function. */
|
/* Define to 1 if you have the `erfc' function. */
|
||||||
#define HAVE_ERFC 1
|
#define HAVE_ERFC 1
|
||||||
|
|
||||||
|
/* framework name */
|
||||||
|
#define PYTHONFRAMEWORK ""
|
||||||
|
|
||||||
#endif /* !Py_CONFIG_H */
|
#endif /* !Py_CONFIG_H */
|
||||||
|
|
Loading…
Reference in New Issue