mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-01 10:12:27 +00:00
Pay off more technical debt
This makes breaking changes to add underscores to many non-standard
function names provided by the c library. MODE=tiny is now tinier and
we now use smaller locks that are better for tiny apps in this mode.
Some headers have been renamed to be in the same folder as the build
package, so it'll be easier to know which build dependency is needed.
Certain old misguided interfaces have been removed. Intel intrinsics
headers are now listed in libc/isystem (but not in the amalgamation)
to help further improve open source compatibility. Header complexity
has also been reduced. Lastly, more shell scripts are now available.
Compared to 6f7d0cb1c3
, some tiny corrections were made in libc/intrin/g_fds.c and libc/zipos/open.c including double semi colons and incorrect indentation for existing vista changes that were manually pulled from this commit previously.
This commit is contained in:
parent
555260d2e5
commit
7b26b42769
959 changed files with 4065 additions and 4868 deletions
4
third_party/python/Python/codecs.c
vendored
4
third_party/python/Python/codecs.c
vendored
|
@ -1009,14 +1009,14 @@ PyObject *PyCodec_NameReplaceErrors(PyObject *exc)
|
|||
return NULL;
|
||||
for (i = start, ressize = 0; i < end; ++i) {
|
||||
/* object is guaranteed to be "ready" */
|
||||
if (!weaken(_PyUnicode_GetUcName)) {
|
||||
if (!_weaken(_PyUnicode_GetUcName)) {
|
||||
PyErr_SetString(
|
||||
PyExc_UnicodeError,
|
||||
"_PyUnicode_GetUcName() not available");
|
||||
return NULL;
|
||||
}
|
||||
c = PyUnicode_READ_CHAR(object, i);
|
||||
if (weaken(_PyUnicode_GetUcName)(NULL, c, buffer, sizeof(buffer), 1)) {
|
||||
if (_weaken(_PyUnicode_GetUcName)(NULL, c, buffer, sizeof(buffer), 1)) {
|
||||
replsize = 1+1+1+(int)strlen(buffer)+1;
|
||||
}
|
||||
else if (c >= 0x10000) {
|
||||
|
|
3
third_party/python/Python/fatality.c
vendored
3
third_party/python/Python/fatality.c
vendored
|
@ -6,6 +6,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/pyerrors.h"
|
||||
|
@ -159,6 +160,6 @@ exit:
|
|||
#if defined(MS_WINDOWS) && defined(_DEBUG)
|
||||
DebugBreak();
|
||||
#endif
|
||||
if (weaken(__die)) weaken(__die)();
|
||||
if (_weaken(__die)) _weaken(__die)();
|
||||
abort();
|
||||
}
|
||||
|
|
6
third_party/python/Python/getcopyright.c
vendored
6
third_party/python/Python/getcopyright.c
vendored
|
@ -4,9 +4,9 @@
|
|||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/intrin/cmpxchg.h"
|
||||
#include "libc/stdio/append.internal.h"
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/stdio/append.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "third_party/python/Include/pylifecycle.h"
|
||||
/* clang-format off */
|
||||
|
@ -32,7 +32,7 @@ Py_GetCopyright(void)
|
|||
static char *res;
|
||||
if (_cmpxchg(&once, 0, 1)) {
|
||||
appends(&res, "");
|
||||
for (p = *weaken(kLegalNotices); *p; p += strlen(p) + 1) {
|
||||
for (p = *_weaken(kLegalNotices); *p; p += strlen(p) + 1) {
|
||||
appends(&res, p);
|
||||
}
|
||||
}
|
||||
|
|
12
third_party/python/Python/import.c
vendored
12
third_party/python/Python/import.c
vendored
|
@ -4,15 +4,15 @@
|
|||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/mem/alg.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/calls/struct/stat.macros.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/alg.h"
|
||||
#include "libc/mem/gc.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/x/x.h"
|
||||
|
@ -887,7 +887,7 @@ PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co,
|
|||
// cpathobj != NULL means cpathname != NULL
|
||||
size_t cpathlen = strlen(cpathname);
|
||||
char *pathname2 = _gc(strdup(cpathname));
|
||||
if (endswith(pathname2, ".pyc"))
|
||||
if (_endswith(pathname2, ".pyc"))
|
||||
{
|
||||
pathname2[cpathlen-2] = '\0'; // so now ends with .py
|
||||
if(!stat(pathname2, &stinfo) && (stinfo.st_mode & S_IFMT) == S_IFREG)
|
||||
|
@ -2370,7 +2370,7 @@ static PyObject *_imp_source_from_cache(PyObject *module, PyObject *arg) {
|
|||
Py_ssize_t pathlen = 0;
|
||||
if (!PyArg_Parse(PyOS_FSPath(arg), "z#:source_from_cache", &path, &pathlen))
|
||||
return NULL;
|
||||
if (!path || !endswith(path, ".pyc")) {
|
||||
if (!path || !_endswith(path, ".pyc")) {
|
||||
PyErr_Format(PyExc_ValueError, "%s does not end in .pyc", path);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2666,7 +2666,7 @@ static PyObject *SFLObject_is_package(SourcelessFileLoader *self,
|
|||
self->name, name);
|
||||
return NULL;
|
||||
}
|
||||
if (startswith(basename(self->path), "__init__")) {
|
||||
if (_startswith(basename(self->path), "__init__")) {
|
||||
Py_RETURN_TRUE;
|
||||
}
|
||||
Py_RETURN_FALSE;
|
||||
|
|
2
third_party/python/Python/marshal.c
vendored
2
third_party/python/Python/marshal.c
vendored
|
@ -9,7 +9,7 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/weirdtypes.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
#include "third_party/python/Include/boolobject.h"
|
||||
#include "third_party/python/Include/code.h"
|
||||
|
|
2
third_party/python/Python/sysmodule.c
vendored
2
third_party/python/Python/sysmodule.c
vendored
|
@ -9,7 +9,7 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/nt/dll.h"
|
||||
#include "libc/nt/version.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue