mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +00:00
Get Cosmopolitan into releasable state
A new rollup tool now exists for flattening out the headers in a way that works better for our purposes than cpp. A lot of the API clutter has been removed. APIs that aren't a sure thing in terms of general recommendation are now marked internal. There's now a smoke test for the amalgamation archive and gigantic header file. So we can now guarantee you can use this project on the easiest difficulty setting without the gigantic repository. A website is being created, which is currently a work in progress: https://justine.storage.googleapis.com/cosmopolitan/index.html
This commit is contained in:
parent
dba7552c1e
commit
ea0b5d9d1c
775 changed files with 6864 additions and 3963 deletions
|
@ -21,12 +21,14 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/nt/files.h"
|
||||
#include "libc/nt/runtime.h"
|
||||
#include "libc/runtime/missioncritical.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/fileno.h"
|
||||
#include "libc/sysv/consts/nr.h"
|
||||
|
||||
#define WasImported(SLOT) \
|
||||
((void *)*SLOT && *SLOT != (void *)&missingno /* see libc/crt/crt.S */)
|
||||
|
||||
static privileged void __print$nt(const void *data, size_t len) {
|
||||
int64_t hand;
|
||||
uint32_t wrote;
|
||||
|
@ -47,11 +49,10 @@ static privileged void __print$nt(const void *data, size_t len) {
|
|||
*
|
||||
* @param len can be computed w/ tinystrlen()
|
||||
* @clob nothing except flags
|
||||
* @see PRINT()
|
||||
*/
|
||||
privileged void __print(const void *data, size_t len) {
|
||||
int64_t ax, ordinal;
|
||||
if (NT_HAVE_IMPORT(__imp_WriteFile)) {
|
||||
if (WasImported(__imp_WriteFile)) {
|
||||
__print$nt(data, len);
|
||||
} else {
|
||||
ordinal = __NR_write > 0 ? __NR_write : IsXnu() ? 0x2000004 : 4;
|
||||
|
@ -59,14 +60,13 @@ privileged void __print(const void *data, size_t len) {
|
|||
: "=a"(ax)
|
||||
: "0"(ordinal), "D"(STDERR_FILENO), "S"(data), "d"(len)
|
||||
: "rcx", "r11", "memory", "cc");
|
||||
if (ax == -1 && !hostos && !__NR_write) {
|
||||
if (ax == -1 && !__hostos && !__NR_write) {
|
||||
asm volatile("syscall"
|
||||
: "=a"(ax)
|
||||
: "0"(ordinal), "D"(STDERR_FILENO), "S"(data), "d"(len)
|
||||
: "rcx", "r11", "memory", "cc");
|
||||
}
|
||||
}
|
||||
RESTORE_RBX();
|
||||
}
|
||||
|
||||
privileged void __print_string(const char *s) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue