Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-102255: Improve build support on xbox #102256

Merged
merged 104 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
58ab04a
better support building on non desktop windows systems
maxbachmann Feb 24, 2023
66a68bd
stub posix apis
maxbachmann Feb 25, 2023
26f5a44
add basic isabs implementation
maxbachmann Feb 25, 2023
68a1f67
implement isxfile
maxbachmann Feb 25, 2023
492bac0
fix static linking
maxbachmann Feb 25, 2023
26b4b24
fix guards
maxbachmann Feb 25, 2023
467bf40
add MS_XBOX
maxbachmann Feb 25, 2023
e734492
cleanup
maxbachmann Feb 25, 2023
fad23bc
use winsock2 on xbox
maxbachmann Feb 26, 2023
b6b28ec
stub winreg
maxbachmann Feb 26, 2023
cdbb1f2
rename to MS_GAMES
maxbachmann Feb 26, 2023
e7622cc
fix guard
maxbachmann Feb 26, 2023
7812891
add missing semicolon
maxbachmann Feb 26, 2023
3b005f4
remove windows console
maxbachmann Feb 26, 2023
fa526b6
do not read version from kernel32.dll
maxbachmann Feb 26, 2023
36887bc
apply part of code review
maxbachmann Feb 26, 2023
6fe3018
reduce diff
maxbachmann Feb 26, 2023
8499940
regenerate argument clinic
maxbachmann Feb 26, 2023
69f0a2c
include winioctl
maxbachmann Feb 26, 2023
f43ce54
exclude dll_directory
maxbachmann Feb 26, 2023
43cf0a5
patch mscvrtmodule
maxbachmann Feb 26, 2023
8f717ea
patch _winapi
maxbachmann Feb 26, 2023
29d5b65
📜🤖 Added by blurb_it.
blurb-it[bot] Feb 26, 2023
8a73500
patch out tzset
maxbachmann Feb 26, 2023
92ae5ef
patch support_wsa_no_inherit
maxbachmann Feb 26, 2023
f27fe95
patch scoketmodule
maxbachmann Feb 26, 2023
f15d9e2
PathCchCombineEx is unavailable on xbox
maxbachmann Feb 26, 2023
d816baa
patch out remaining funcs
maxbachmann Feb 26, 2023
2ba0a87
Merge branch 'main' into xbox
maxbachmann Feb 26, 2023
ed17e03
apply code review
maxbachmann Feb 26, 2023
c360b4a
cleanup
maxbachmann Feb 26, 2023
3b5b119
remove unneded defined
maxbachmann Feb 26, 2023
975191a
regenerate argument clinic
maxbachmann Feb 26, 2023
91a95f2
remove unused function
maxbachmann Feb 26, 2023
3be5fa7
use processsnapshot api
maxbachmann Feb 26, 2023
6bd1207
simplify implementation
maxbachmann Feb 26, 2023
ca98366
simplify implementation
maxbachmann Feb 26, 2023
fac3431
follow pep7
maxbachmann Feb 26, 2023
c1bf0e2
follow pep7
maxbachmann Feb 26, 2023
ace99f6
Update Modules/posixmodule.c
maxbachmann Feb 26, 2023
e83d398
remove duplicated comment
maxbachmann Feb 26, 2023
76ea310
test error message as well
maxbachmann Feb 26, 2023
2f1d19c
fix condition
maxbachmann Feb 26, 2023
559199f
use sys._base_executable
maxbachmann Feb 26, 2023
b119bf5
do not build mmap on unsupported platforms
maxbachmann Feb 26, 2023
1dd69e8
Apply suggestions from code review
maxbachmann Feb 27, 2023
a1e6dba
add inheritable back
maxbachmann Feb 27, 2023
7a45988
Update Python/fileutils.c
maxbachmann Feb 27, 2023
846f8eb
Update Python/fileutils.c
maxbachmann Feb 27, 2023
a56f215
add back some winreg APIs
maxbachmann Feb 27, 2023
191cab2
regenerate argument clinic
maxbachmann Feb 27, 2023
144280e
do not name platform xbox
maxbachmann Feb 27, 2023
ca9f7d9
exclude functions
maxbachmann Feb 27, 2023
30c0818
implement without nt._path_splitroot
maxbachmann Feb 27, 2023
6ebb05b
Update Modules/socketmodule.c
maxbachmann Feb 27, 2023
fc5c642
apply some code review change requests
maxbachmann Feb 27, 2023
5f286a7
get rid of support_wsa_no_inherit
maxbachmann Feb 27, 2023
3be5e3c
implement _path_splitroot
maxbachmann Feb 27, 2023
d9e1663
Merge branch 'main' into xbox
maxbachmann Feb 28, 2023
2a2a8fd
fix revert of changes to _bootstrap_external
maxbachmann Feb 28, 2023
165286d
reimplement winreg_QueryValue_impl and winreg_SetValue_impl
maxbachmann Feb 28, 2023
1413849
Update Python/fileutils.c
maxbachmann Feb 28, 2023
6465d73
move skip root to own function
maxbachmann Feb 28, 2023
3f0c6f0
cleanup
maxbachmann Feb 28, 2023
8f3a262
better handle joinfile on xbox
maxbachmann Feb 28, 2023
6b8074e
cleanup
maxbachmann Feb 28, 2023
99b6a1d
Update Modules/socketmodule.c
maxbachmann Feb 28, 2023
d0e548d
define missing flags on non desktop builds
maxbachmann Feb 28, 2023
c569a18
set inherit in WASSocketW
maxbachmann Feb 28, 2023
3e86c9e
add back dynamic loading
maxbachmann Feb 28, 2023
d5cb524
more cleanup
maxbachmann Feb 28, 2023
63267d8
rename platform defines
maxbachmann Feb 28, 2023
79f2bfe
add missing inherit flag
maxbachmann Feb 28, 2023
fc6b942
fix guard
maxbachmann Feb 28, 2023
05e9859
use api partititions
maxbachmann Feb 28, 2023
9769662
fix guards
maxbachmann Feb 28, 2023
8f12bf8
add missing include
maxbachmann Mar 1, 2023
509d0f5
Merge branch 'main' into xbox
maxbachmann Mar 1, 2023
f20fea8
apply code review
maxbachmann Mar 1, 2023
e33a42f
move replacement functions into fileutils
maxbachmann Mar 1, 2023
556a8e1
disable dynamic load of pythoncore for static lib
maxbachmann Mar 1, 2023
aa8964b
Merge branch 'main' into xbox
maxbachmann Mar 1, 2023
74258ca
use core dll for windows specific
maxbachmann Mar 1, 2023
686da59
Update Python/fileutils.c
maxbachmann Mar 1, 2023
b151f7f
apply code review
maxbachmann Mar 1, 2023
39d2d13
rename to PathCchCombineEx
maxbachmann Mar 1, 2023
2895563
define for all BUILD_CORE
maxbachmann Mar 1, 2023
8e3d3c5
cleanup
maxbachmann Mar 1, 2023
659d1a3
Update Modules/_randommodule.c
maxbachmann Mar 1, 2023
e9ff60e
add MS_WINDOWS_CRT_DESKTOP
maxbachmann Mar 2, 2023
32c4886
Update Modules/posixmodule.c
maxbachmann Mar 2, 2023
2f1fe40
Update Modules/posixmodule.c
maxbachmann Mar 2, 2023
5854e91
revert MS_WINDOWS_CRT_DESKTOP
maxbachmann Mar 2, 2023
d3d2e1c
use MS_WINDOWS_SYSTEM
maxbachmann Mar 3, 2023
b1ffce9
Apply suggestions from code review
maxbachmann Mar 3, 2023
0b4d407
Update Modules/socketmodule.c
maxbachmann Mar 3, 2023
d9976dc
handle failing malloc
maxbachmann Mar 3, 2023
427de79
Update Modules/posixmodule.c
maxbachmann Mar 4, 2023
603cea7
Update Python/fileutils.c
maxbachmann Mar 6, 2023
6db80a3
Update Include/internal/pycore_fileutils.h
maxbachmann Mar 6, 2023
4d78066
Update Include/internal/pycore_fileutils.h
maxbachmann Mar 6, 2023
65cdd56
Update Python/fileutils.c
maxbachmann Mar 6, 2023
35217ab
Update Python/fileutils.c
maxbachmann Mar 7, 2023
331b1f4
dynamically import from api-ms-win-core-path-l1-1-0.dll
maxbachmann Mar 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Modules/_io/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
#ifdef MS_WINDOWS
/* can simulate truncate with Win32 API functions; see file_truncate */
#define HAVE_FTRUNCATE
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif

Expand Down
2 changes: 2 additions & 0 deletions Modules/_io/winconsoleio.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
#endif
#include <stddef.h> /* For offsetof */

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <fcntl.h>

Expand Down
8 changes: 5 additions & 3 deletions Modules/_localemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ This software comes with no warranty. Use at your own risk.
#endif

#if defined(MS_WINDOWS)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#endif

Expand Down Expand Up @@ -457,12 +459,12 @@ _locale__getdefaultlocale_impl(PyObject *module)

PyOS_snprintf(encoding, sizeof(encoding), "cp%u", GetACP());

if (GetLocaleInfo(LOCALE_USER_DEFAULT,
if (GetLocaleInfoA(LOCALE_USER_DEFAULT,
LOCALE_SISO639LANGNAME,
locale, sizeof(locale))) {
Py_ssize_t i = strlen(locale);
locale[i++] = '_';
if (GetLocaleInfo(LOCALE_USER_DEFAULT,
if (GetLocaleInfoA(LOCALE_USER_DEFAULT,
LOCALE_SISO3166CTRYNAME,
locale+i, (int)(sizeof(locale)-i)))
return Py_BuildValue("ss", locale, encoding);
Expand All @@ -474,7 +476,7 @@ _locale__getdefaultlocale_impl(PyObject *module)

locale[0] = '0';
locale[1] = 'x';
if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTLANGUAGE,
if (GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTLANGUAGE,
locale+2, sizeof(locale)-2)) {
return Py_BuildValue("ss", locale, encoding);
}
Expand Down
4 changes: 3 additions & 1 deletion Modules/_multiprocessing/multiprocessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
*/

#ifdef MS_WINDOWS
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
# include <winsock2.h>
# include <process.h> /* getpid() */
Expand Down
6 changes: 6 additions & 0 deletions Modules/_pickle.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ enum {
#define FLOAT FLOAT_
#define INT INT_
#define LONG LONG_

/* This can already be defined on Windows to set the character set
the Windows header files treat as default */
#ifdef UNICODE
#undef UNICODE
#endif
#endif

/* Pickle opcodes. These must be kept updated with pickle.py.
Expand Down
6 changes: 6 additions & 0 deletions Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
# endif
#endif

/* the deprecated posix apis are not available on xbox */
#ifdef MS_XBOX
# define dup _dup
# define dup2 _dup2
#endif

#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__DragonFly__)
# define FD_DIR "/dev/fd"
#else
Expand Down
4 changes: 4 additions & 0 deletions Modules/_randommodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
# include <process.h> // getpid()
#endif

#ifdef MS_WINDOWS_NON_DESKTOP
maxbachmann marked this conversation as resolved.
Show resolved Hide resolved
# include <windows.h>
#endif

/* Period parameters -- These are all magic. Don't change. */
#define N 624
#define M 397
Expand Down
2 changes: 2 additions & 0 deletions Modules/errnomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

/* Windows socket errors (WSA*) */
#ifdef MS_WINDOWS
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
/* The following constants were added to errno.h in VS2010 but have
preferred WSA equivalents. */
Expand Down
12 changes: 12 additions & 0 deletions Modules/getpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#ifdef MS_WINDOWS
# include <windows.h> // GetFullPathNameW(), MAX_PATH
# include <pathcch.h>
# ifdef MS_XBOX
# define wcsicmp _wcsicmp
# endif
#endif

#ifdef __APPLE__
Expand Down Expand Up @@ -228,10 +231,17 @@ getpath_isxfile(PyObject *Py_UNUSED(self), PyObject *args)
if (path) {
#ifdef MS_WINDOWS
const wchar_t *ext;
#ifdef MS_XBOX
ext = (cchPath >= 4) ? path + cchPath - 4 : NULL;
#endif
DWORD attr = GetFileAttributesW(path);
r = (attr != INVALID_FILE_ATTRIBUTES) &&
!(attr & FILE_ATTRIBUTE_DIRECTORY) &&
#ifdef MS_XBOX
(ext != NULL) &&
#else
SUCCEEDED(PathCchFindExtension(path, cchPath + 1, &ext)) &&
#endif
(CompareStringOrdinal(ext, -1, L".exe", -1, 1 /* ignore case */) == CSTR_EQUAL)
? Py_True : Py_False;
#else
Expand Down Expand Up @@ -746,10 +756,12 @@ static int
library_to_dict(PyObject *dict, const char *key)
{
#ifdef MS_WINDOWS
#ifdef Py_ENABLE_SHARED
extern HMODULE PyWin_DLLhModule;
if (PyWin_DLLhModule) {
return winmodule_to_dict(dict, key, PyWin_DLLhModule);
}
maxbachmann marked this conversation as resolved.
Show resolved Hide resolved
#endif
#elif defined(WITH_NEXT_FRAMEWORK)
static char modPath[MAXPATHLEN + 1];
static int modPathInitialized = -1;
Expand Down
21 changes: 13 additions & 8 deletions Modules/mmapmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
# endif /* HAVE_FCNTL_H */
#endif

/* the deprecated posix apis are not available on xbox */
#ifdef MS_XBOX
# define lseek _lseek
#endif

#ifdef MS_WINDOWS
#include <windows.h>
static int
Expand Down Expand Up @@ -502,7 +507,7 @@ mmap_resize_method(mmap_object *self,
CloseHandle(self->map_handle);
/* if the file mapping still exists, it cannot be resized. */
if (self->tagname) {
self->map_handle = OpenFileMapping(FILE_MAP_WRITE, FALSE,
self->map_handle = OpenFileMappingA(FILE_MAP_WRITE, FALSE,
maxbachmann marked this conversation as resolved.
Show resolved Hide resolved
self->tagname);
if (self->map_handle) {
PyErr_SetFromWindowsErr(ERROR_USER_MAPPED_FILE);
Expand Down Expand Up @@ -531,7 +536,7 @@ mmap_resize_method(mmap_object *self,

/* create a new file mapping and map a new view */
/* FIXME: call CreateFileMappingW with wchar_t tagname */
self->map_handle = CreateFileMapping(
self->map_handle = CreateFileMappingA(
self->file_handle,
NULL,
PAGE_READWRITE,
Expand Down Expand Up @@ -1514,12 +1519,12 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
off_lo = (DWORD)(offset & 0xFFFFFFFF);
/* For files, it would be sufficient to pass 0 as size.
For anonymous maps, we have to pass the size explicitly. */
m_obj->map_handle = CreateFileMapping(m_obj->file_handle,
NULL,
flProtect,
size_hi,
size_lo,
m_obj->tagname);
m_obj->map_handle = CreateFileMappingA(m_obj->file_handle,
NULL,
flProtect,
size_hi,
size_lo,
m_obj->tagname);
if (m_obj->map_handle != NULL) {
m_obj->data = (char *) MapViewOfFile(m_obj->map_handle,
dwDesiredAccess,
Expand Down
41 changes: 29 additions & 12 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
# include <pathcch.h>
# include <lmcons.h> // UNLEN
# include "osdefs.h" // SEP
# define HAVE_SYMLINK
# ifndef MS_WINDOWS_NON_DESKTOP
# define HAVE_SYMLINK
# endif
#endif

#ifdef __VXWORKS__
Expand Down Expand Up @@ -312,7 +314,7 @@ corresponding Unix manual entries for more information on calls.");
# include <sys/syscall.h>
#endif

#if defined(MS_WINDOWS)
#if defined(MS_WINDOWS) && !defined(MS_WINDOWS_NON_DESKTOP)
maxbachmann marked this conversation as resolved.
Show resolved Hide resolved
# define TERMSIZE_USE_CONIO
#elif defined(HAVE_SYS_IOCTL_H)
# include <sys/ioctl.h>
Expand All @@ -322,29 +324,35 @@ corresponding Unix manual entries for more information on calls.");
# if defined(TIOCGWINSZ)
# define TERMSIZE_USE_IOCTL
# endif
#endif /* MS_WINDOWS */
#endif /* MS_WINDOWS && !MS_WINDOWS_NON_DESKTOP */

/* Various compilers have only certain posix functions */
/* XXX Gosh I wish these were all moved into pyconfig.h */
#if defined(__WATCOMC__) && !defined(__QNX__) /* Watcom compiler */
# define HAVE_OPENDIR 1
# define HAVE_SYSTEM 1
# include <process.h>
#else
# ifdef _MSC_VER
/* Microsoft compiler */
#elif defined( _MSC_VER)
/* Microsoft compiler */
# ifndef MS_WINDOWS_NON_DESKTOP
maxbachmann marked this conversation as resolved.
Show resolved Hide resolved
# define HAVE_GETPPID 1
# define HAVE_GETLOGIN 1
# define HAVE_SPAWNV 1
# define HAVE_EXECV 1
# define HAVE_WSPAWNV 1
# define HAVE_WEXECV 1
# define HAVE_PIPE 1
# define HAVE_SYSTEM 1
# define HAVE_CWAIT 1
# define HAVE_FSYNC 1
# define fsync _commit
# endif /* _MSC_VER */
# endif /* !MS_WINDOWS_NON_DESKTOP */
# define HAVE_PIPE 1
# define HAVE_FSYNC 1
# define fsync _commit
# ifdef MS_XBOX
# define dup2 _dup2
# define umask _umask
# define close _close
# define isatty _isatty
maxbachmann marked this conversation as resolved.
Show resolved Hide resolved
# endif
#endif /* ! __WATCOMC__ || __QNX__ */

/*[clinic input]
Expand Down Expand Up @@ -4471,9 +4479,18 @@ os__path_splitroot_impl(PyObject *module, path_t *path)
*p = L'\\';
}

#ifdef MS_XBOX
/* this does not handle persistent local storage */
ret = E_FAIL;
if ((wcsncmp(buffer, L"G:\\", 3) == 0) || (wcsncmp(buffer, L"D:\\", 3) == 0) || (wcsncmp(buffer, L"T:\\", 3) == 0)) {
end = buffer + 3;
ret = S_OK;
}
#else
Py_BEGIN_ALLOW_THREADS
ret = PathCchSkipRoot(buffer, &end);
Py_END_ALLOW_THREADS
#endif
if (FAILED(ret)) {
result = Py_BuildValue("sO", "", path->object);
} else if (end != buffer) {
Expand Down Expand Up @@ -8385,9 +8402,9 @@ os_getuid_impl(PyObject *module)
#endif /* HAVE_GETUID */


#ifdef MS_WINDOWS
#if defined(MS_WINDOWS) && !defined(MS_WINDOWS_NON_DESKTOP)
maxbachmann marked this conversation as resolved.
Show resolved Hide resolved
#define HAVE_KILL
#endif /* MS_WINDOWS */
#endif /* MS_WINDOWS && !MS_WINDOWS_NON_DESKTOP */

#ifdef HAVE_KILL
/*[clinic input]
Expand Down
4 changes: 3 additions & 1 deletion Modules/selectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ extern void bzero(void *, int);
#endif

#ifdef MS_WINDOWS
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <winsock.h>
#else
# define SOCKET int
Expand Down
4 changes: 3 additions & 1 deletion Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
# include <i86.h>
#else
# ifdef MS_WINDOWS
# define WIN32_LEAN_AND_MEAN
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
# endif /* MS_WINDOWS */
#endif /* !__WATCOMC__ || __QNX__ */
Expand Down
6 changes: 6 additions & 0 deletions Objects/fileobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_runtime.h" // _PyRuntime

/* the deprecated posix apis are not available on xbox */
#ifdef MS_XBOX
# define isatty _isatty
# define fileno _fileno
#endif

#if defined(HAVE_GETC_UNLOCKED) && !defined(_Py_MEMORY_SANITIZER)
/* clang MemorySanitizer doesn't yet understand getc_unlocked. */
#define GETC(f) getc_unlocked(f)
Expand Down
5 changes: 5 additions & 0 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
# error "Py_LIMITED_API macro must not be defined"
#endif

/* the deprecated posix apis are not available on xbox */
#ifdef MS_XBOX
# define fileno _fileno
#endif

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
4 changes: 4 additions & 0 deletions Objects/obmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#include <stdlib.h> // malloc()
#include <stdbool.h>

/* the deprecated posix apis are not available on xbox */
#ifdef MS_XBOX
# define fileno _fileno
#endif

#undef uint
#define uint pymem_uint
Expand Down
8 changes: 7 additions & 1 deletion PC/pyconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ WIN32 is still required for the locale module.
#define MS_WINDOWS_NON_DESKTOP
#endif

#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_GAMES)
#define MS_XBOX
#endif
maxbachmann marked this conversation as resolved.
Show resolved Hide resolved

/* Compiler specific defines */

/* ------------------------------------------------------------------------*/
Expand Down Expand Up @@ -498,7 +502,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* #define HAVE_CLOCK */

/* Define when any dynamic module loading is enabled */
#define HAVE_DYNAMIC_LOADING
#ifndef MS_XBOX
# define HAVE_DYNAMIC_LOADING
maxbachmann marked this conversation as resolved.
Show resolved Hide resolved
#endif

/* Define if you have ftime. */
#define HAVE_FTIME
Expand Down
6 changes: 6 additions & 0 deletions Parser/myreadline.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
#include "pycore_fileutils.h" // _Py_BEGIN_SUPPRESS_IPH
#include "pycore_pystate.h" // _PyThreadState_GET()
#ifdef MS_WINDOWS
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include "windows.h"
# ifdef MS_XBOX
# define isatty _isatty
# define fileno _fileno
# endif
#endif /* MS_WINDOWS */


Expand Down
Loading