mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
Undiamond Python headers
This change gets the Python codebase into a state where it conforms to the conventions of this codebase. It's now possible to include headers from Python, without worrying about ordering. Python has traditionally solved that problem by "diamonding" everything in Python.h, but that's problematic since it means any change to any Python header invalidates all the build artifacts. Lastly it makes tooling not work. Since it is hard to explain to Emacs when I press C-c C-h to add an import line it shouldn't add the header that actually defines the symbol, and instead do follow the nonstandard Python convention. Progress has been made on letting Python load source code from the zip executable structure via the standard C library APIs. System calss now recognizes zip!FILENAME alternative URIs as equivalent to zip:FILENAME since Python uses colon as its delimiter. Some progress has been made on embedding the notice license terms into the Python object code. This is easier said than done since Python has an extremely complicated ownership story. - Some termios APIs have been added - Implement rewinddir() dirstream API - GetCpuCount() API added to Cosmopolitan Libc - More bugs in Cosmopolitan Libc have been fixed - zipobj.com now has flags for mangling the path - Fixed bug a priori with sendfile() on certain BSDs - Polyfill F_DUPFD and F_DUPFD_CLOEXEC across platforms - FIOCLEX / FIONCLEX now polyfilled for fast O_CLOEXEC changes - APE now supports a hybrid solution to no-self-modify for builds - Many BSD-only magnums added, e.g. O_SEARCH, O_SHLOCK, SF_NODISKIO
This commit is contained in:
parent
20bb8db9f8
commit
b420ed8248
762 changed files with 18410 additions and 53772 deletions
|
@ -9,7 +9,7 @@ COSMOPOLITAN_C_START_
|
|||
|
||||
extern const uint8_t gperf_downcase[256];
|
||||
extern const uint8_t kToLower[256];
|
||||
extern const uint16_t kToLower16[256];
|
||||
extern const uint8_t kToUpper[256];
|
||||
extern const uint8_t kBase36[256];
|
||||
extern const char16_t kCp437[256];
|
||||
|
||||
|
@ -80,12 +80,14 @@ wint_t towupper(wint_t);
|
|||
│ cosmopolitan § strings ─╬─│┼
|
||||
╚────────────────────────────────────────────────────────────────────────────│*/
|
||||
|
||||
void bzero(void *, size_t) libcesque;
|
||||
void *memset(void *, int, size_t) memcpyesque;
|
||||
void *memcpy(void *restrict, const void *restrict, size_t) memcpyesque;
|
||||
void *mempcpy(void *restrict, const void *restrict, size_t) memcpyesque;
|
||||
void *memccpy(void *restrict, const void *restrict, int, size_t) memcpyesque;
|
||||
void *memmove(void *, const void *, size_t) memcpyesque;
|
||||
void *memeqmask(void *, const void *, const void *, size_t) memcpyesque;
|
||||
void explicit_bzero(void *, size_t);
|
||||
|
||||
size_t strlen(const char *) strlenesque;
|
||||
size_t strnlen(const char *, size_t) strlenesque;
|
||||
|
@ -95,8 +97,6 @@ char *index(const char *, int) strlenesque;
|
|||
void *memchr(const void *, int, size_t) strlenesque;
|
||||
char *strchrnul(const char *, int) strlenesque returnsnonnull;
|
||||
void *rawmemchr(const void *, int) strlenesque returnsnonnull;
|
||||
void bzero(void *, size_t) paramsnonnull() libcesque;
|
||||
void explicit_bzero(void *, size_t) paramsnonnull() libcesque;
|
||||
size_t strlen16(const char16_t *) strlenesque;
|
||||
size_t strnlen16(const char16_t *, size_t) strlenesque;
|
||||
size_t strnlen16_s(const char16_t *, size_t);
|
||||
|
@ -161,6 +161,8 @@ char *strcpy(char *, const char *) memcpyesque;
|
|||
char16_t *strcpy16(char16_t *, const char16_t *) memcpyesque;
|
||||
wchar_t *wcscpy(wchar_t *, const wchar_t *) memcpyesque;
|
||||
char *strncat(char *, const char *, size_t) memcpyesque;
|
||||
char16_t *strncat16(char16_t *, const char16_t *, size_t) memcpyesque;
|
||||
wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t) memcpyesque;
|
||||
char *strncpy(char *, const char *, size_t) memcpyesque;
|
||||
char *strtok(char *, const char *) paramsnonnull((2)) libcesque;
|
||||
char *strtok_r(char *, const char *, char **) paramsnonnull((2, 3));
|
||||
|
@ -183,8 +185,7 @@ compatfn wchar_t *wmempcpy(wchar_t *, const wchar_t *, size_t) memcpyesque;
|
|||
compatfn wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t) memcpyesque;
|
||||
int timingsafe_memcmp(const void *, const void *, size_t);
|
||||
void *tinymemccpy(void *, const void *, int, size_t) memcpyesque;
|
||||
void *memmem(const void *, size_t, const void *, size_t)
|
||||
paramsnonnull() nothrow nocallback nosideeffect;
|
||||
void *memmem(const void *, size_t, const void *, size_t) libcesque nosideeffect;
|
||||
char *strerror(int) returnsnonnull nothrow nocallback;
|
||||
long a64l(const char *);
|
||||
char *l64a(long);
|
||||
|
@ -325,17 +326,6 @@ char *strsignal(int) returnsnonnull libcesque;
|
|||
DeSt; \
|
||||
})
|
||||
|
||||
#define explicit_bzero(STR, BYTES) \
|
||||
do { \
|
||||
void *Str; \
|
||||
size_t Bytes; \
|
||||
asm volatile("call\texplicit_bzero" \
|
||||
: "=D"(Str), "=S"(Bytes) \
|
||||
: "0"(STR), "1"(BYTES) \
|
||||
: "rax", "rcx", "rdx", "r8", "r9", "r10", "r11", "memory", \
|
||||
"cc", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5"); \
|
||||
} while (0)
|
||||
|
||||
#else /* hosted+sse2 */
|
||||
|
||||
#define mempcpy(DEST, SRC, SIZE) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue