mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Source changes for compilation
These are the commits from https://github.com/ahgamut/cpython/tree/cosmo_py36 squashed for simplicity. Also included is the pyconfig.h used for compilation. The pyconfig.h has to be changed manually in case Cosmopolitan gets new features.
This commit is contained in:
parent
0c4c56ff39
commit
5ef64dbcdb
82 changed files with 2009 additions and 424 deletions
4
third_party/python/Python/pylifecycle.c
vendored
4
third_party/python/Python/pylifecycle.c
vendored
|
@ -236,7 +236,7 @@ get_locale_encoding(void)
|
|||
return NULL;
|
||||
}
|
||||
return get_codec_name(codeset);
|
||||
#elif defined(__ANDROID__)
|
||||
#elif 1 || defined(__ANDROID__)
|
||||
return get_codec_name("UTF-8");
|
||||
#else
|
||||
PyErr_SetNone(PyExc_NotImplementedError);
|
||||
|
@ -1424,7 +1424,7 @@ Py_FatalError(const char *msg)
|
|||
|
||||
/* Check if the current thread has a Python thread state
|
||||
and holds the GIL */
|
||||
PyThreadState *tss_tstate = PyGILState_GetThisThreadState();
|
||||
PyThreadState *tss_tstate = NULL; // PyGILState_GetThisThreadState();
|
||||
if (tss_tstate != NULL) {
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
if (tss_tstate != tstate) {
|
||||
|
|
2
third_party/python/Python/pytime.c
vendored
2
third_party/python/Python/pytime.c
vendored
|
@ -28,6 +28,8 @@
|
|||
#define NS_TO_MS (1000 * 1000)
|
||||
#define NS_TO_US (1000)
|
||||
|
||||
typedef int clockid_t;
|
||||
|
||||
static void
|
||||
error_time_t_overflow(void)
|
||||
{
|
||||
|
|
4
third_party/python/Python/sysmodule.c
vendored
4
third_party/python/Python/sysmodule.c
vendored
|
@ -2121,7 +2121,9 @@ void
|
|||
PySys_SetPath(const wchar_t *path)
|
||||
{
|
||||
PyObject *v;
|
||||
if ((v = makepathobject(path, DELIM)) == NULL)
|
||||
int delim = DELIM;
|
||||
if(IsWindows()) delim = L';';
|
||||
if ((v = makepathobject(path, delim)) == NULL)
|
||||
Py_FatalError("can't create sys.path");
|
||||
if (_PySys_SetObjectId(&PyId_path, v) != 0)
|
||||
Py_FatalError("can't assign sys.path");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue