mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-30 14:30: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
7
third_party/lua/ldo.c
vendored
7
third_party/lua/ldo.c
vendored
|
@ -29,7 +29,7 @@
|
|||
#define LUA_CORE
|
||||
#include "libc/intrin/weaken.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/gc.h"
|
||||
#include "libc/mem/gc.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/str/str.h"
|
||||
|
@ -153,9 +153,8 @@ l_noret luaD_throw (lua_State *L, int errcode) {
|
|||
lua_unlock(L);
|
||||
g->panic(L); /* call panic function (last chance to jump out) */
|
||||
}
|
||||
if (weaken(__die)) weaken(__die)();
|
||||
__restorewintty();
|
||||
_Exit(41);
|
||||
if (_weaken(__die)) _weaken(__die)();
|
||||
_Exitr(41);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
4
third_party/lua/lobject.h
vendored
4
third_party/lua/lobject.h
vendored
|
@ -1,7 +1,7 @@
|
|||
#ifndef lobject_h
|
||||
#define lobject_h
|
||||
|
||||
#include "libc/nexgen32e/bsr.h"
|
||||
#include "libc/intrin/bsr.h"
|
||||
#include "third_party/lua/llimits.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
|
||||
|
@ -786,7 +786,7 @@ LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t srclen);
|
|||
** Computes ceil(log2(x))
|
||||
*/
|
||||
static inline int luaO_ceillog2 (unsigned int x) {
|
||||
return --x ? bsr(x) + 1 : 0;
|
||||
return --x ? _bsr(x) + 1 : 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
10
third_party/lua/lrepl.c
vendored
10
third_party/lua/lrepl.c
vendored
|
@ -26,20 +26,20 @@
|
|||
│ │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lua_c
|
||||
#include "libc/mem/alg.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/nomultics.internal.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/log/check.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/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/sa.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "third_party/linenoise/linenoise.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
|
@ -148,7 +148,7 @@ void lua_readline_completions (const char *p, linenoiseCompletions *c) {
|
|||
while (lua_next(L, -2)) {
|
||||
if (lua_type(L, -2) == LUA_TSTRING) {
|
||||
name = lua_tolstring(L, -2, &n);
|
||||
if (startswithi(name, a) && (s = malloc(a - p + n + 1))) {
|
||||
if (_startswithi(name, a) && (s = malloc(a - p + n + 1))) {
|
||||
memcpy(s, p, a - p);
|
||||
memcpy(s + (a - p), name, n + 1);
|
||||
lua_readline_addcompletion(c, s);
|
||||
|
@ -161,7 +161,7 @@ void lua_readline_completions (const char *p, linenoiseCompletions *c) {
|
|||
lua_pop(L, 1); // pop table
|
||||
|
||||
for (i = 0; i < ARRAYLEN(kKeywordHints); ++i) {
|
||||
if (startswithi(kKeywordHints[i], p)) {
|
||||
if (_startswithi(kKeywordHints[i], p)) {
|
||||
if ((s = strdup(kKeywordHints[i]))) {
|
||||
lua_readline_addcompletion(c, s);
|
||||
}
|
||||
|
|
2
third_party/lua/lua.main.c
vendored
2
third_party/lua/lua.main.c
vendored
|
@ -31,7 +31,7 @@
|
|||
#include "libc/dce.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/runtime/gc.h"
|
||||
#include "libc/mem/gc.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/sock/sock.h"
|
||||
#include "libc/sock/struct/pollfd.h"
|
||||
|
|
4
third_party/lua/luaencodejsondata.c
vendored
4
third_party/lua/luaencodejsondata.c
vendored
|
@ -23,9 +23,9 @@
|
|||
#include "libc/log/log.h"
|
||||
#include "libc/log/rop.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/mem/gc.internal.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/stdio/append.internal.h"
|
||||
#include "libc/stdio/append.h"
|
||||
#include "libc/stdio/strlist.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "net/http/escape.h"
|
||||
|
|
2
third_party/lua/luaencodeluadata.c
vendored
2
third_party/lua/luaencodeluadata.c
vendored
|
@ -23,7 +23,7 @@
|
|||
#include "libc/math.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/stdio/append.internal.h"
|
||||
#include "libc/stdio/append.h"
|
||||
#include "libc/stdio/strlist.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/x/x.h"
|
||||
|
|
2
third_party/lua/luaformatstack.c
vendored
2
third_party/lua/luaformatstack.c
vendored
|
@ -16,7 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/stdio/append.internal.h"
|
||||
#include "libc/stdio/append.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
#include "third_party/lua/lauxlib.h"
|
||||
|
||||
|
|
12
third_party/lua/lunix.c
vendored
12
third_party/lua/lunix.c
vendored
|
@ -21,13 +21,13 @@
|
|||
#include "libc/calls/ioctl.h"
|
||||
#include "libc/calls/makedev.h"
|
||||
#include "libc/calls/pledge.h"
|
||||
#include "libc/calls/strace.internal.h"
|
||||
#include "libc/calls/struct/bpf.h"
|
||||
#include "libc/calls/struct/dirent.h"
|
||||
#include "libc/calls/struct/flock.h"
|
||||
#include "libc/calls/struct/itimerval.h"
|
||||
#include "libc/calls/struct/rlimit.h"
|
||||
#include "libc/calls/struct/rusage.h"
|
||||
#include "libc/calls/struct/sigaction.h"
|
||||
#include "libc/calls/struct/siginfo.h"
|
||||
#include "libc/calls/struct/sigset.h"
|
||||
#include "libc/calls/struct/stat.h"
|
||||
|
@ -43,6 +43,7 @@
|
|||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/fmt/magnumstrs.internal.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/intrin/strace.internal.h"
|
||||
#include "libc/log/log.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/fmt.h"
|
||||
|
@ -56,9 +57,8 @@
|
|||
#include "libc/sock/struct/linger.h"
|
||||
#include "libc/sock/struct/pollfd.h"
|
||||
#include "libc/sock/syslog.h"
|
||||
#include "libc/stdio/append.internal.h"
|
||||
#include "libc/stdio/append.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/errfun.h"
|
||||
#include "libc/str/path.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/af.h"
|
||||
|
@ -2589,11 +2589,11 @@ static int LuaUnixErrnoWinerr(lua_State *L) {
|
|||
}
|
||||
|
||||
static int LuaUnixErrnoName(lua_State *L) {
|
||||
return ReturnString(L, strerrno(GetUnixErrno(L)->errno_));
|
||||
return ReturnString(L, _strerrno(GetUnixErrno(L)->errno_));
|
||||
}
|
||||
|
||||
static int LuaUnixErrnoDoc(lua_State *L) {
|
||||
return ReturnString(L, strerdoc(GetUnixErrno(L)->errno_));
|
||||
return ReturnString(L, _strerdoc(GetUnixErrno(L)->errno_));
|
||||
}
|
||||
|
||||
static int LuaUnixErrnoCall(lua_State *L) {
|
||||
|
@ -2608,7 +2608,7 @@ static int LuaUnixErrnoToString(lua_State *L) {
|
|||
strerror_wr(e->errno_, e->winerr, msg, sizeof(msg));
|
||||
lua_pushfstring(L, "%s() failed: %s", e->call, msg);
|
||||
} else {
|
||||
lua_pushstring(L, strerrno(e->errno_));
|
||||
lua_pushstring(L, _strerrno(e->errno_));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
2
third_party/lua/serialize.c
vendored
2
third_party/lua/serialize.c
vendored
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/log/rop.h"
|
||||
#include "libc/stdio/append.internal.h"
|
||||
#include "libc/stdio/append.h"
|
||||
#include "third_party/lua/cosmo.h"
|
||||
#include "third_party/lua/lua.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue