Skip to content

Commit 6f7d0cb

Browse files
committed
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.
1 parent b69f3d2 commit 6f7d0cb

File tree

960 files changed

+4072
-4873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

960 files changed

+4072
-4873
lines changed

ape/ape.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#include "libc/elf/def.h"
4040
#include "libc/macho.internal.h"
4141
#include "libc/nexgen32e/uart.internal.h"
42-
#include "libc/nexgen32e/vidya.internal.h"
4342
#include "libc/nt/pedef.internal.h"
4443
#include "libc/runtime/pc.internal.h"
4544
#include "libc/sysv/consts/prot.h"

dsp/scale/gyarados.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
#include "dsp/core/ituround.h"
2222
#include "dsp/core/q.h"
2323
#include "dsp/core/twixt8.h"
24+
#include "libc/intrin/bsr.h"
2425
#include "libc/limits.h"
2526
#include "libc/log/check.h"
2627
#include "libc/log/log.h"
2728
#include "libc/macros.internal.h"
2829
#include "libc/math.h"
30+
#include "libc/mem/gc.internal.h"
2931
#include "libc/mem/mem.h"
30-
#include "libc/nexgen32e/bsr.h"
31-
#include "libc/runtime/gc.internal.h"
3232
#include "libc/str/str.h"
3333
#include "libc/testlib/testlib.h"
3434
#include "libc/x/x.h"
@@ -203,8 +203,8 @@ void *Gyarados(long dyw, long dxw, int dst[dyw][dxw], long syw, long sxw,
203203
CHECK_LE(sxn, sxw);
204204
CHECK_LE(dyn, dyw);
205205
CHECK_LE(dxn, dxw);
206-
CHECK_LT(bsrl(syn) + bsrl(sxn), 32);
207-
CHECK_LT(bsrl(dyn) + bsrl(dxn), 32);
206+
CHECK_LT(_bsrl(syn) + _bsrl(sxn), 32);
207+
CHECK_LT(_bsrl(dyn) + _bsrl(dxn), 32);
208208
CHECK_LE(dyw, 0x7fff);
209209
CHECK_LE(dxw, 0x7fff);
210210
CHECK_LE(syw, 0x7fff);

dsp/tty/ident.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ int ttyident(struct TtyIdent *ti, int ttyinfd, int ttyoutfd) {
8383
if (ttyident_probe(ti, ttyinfd, ttyoutfd, "\e[>c") != -1) {
8484
rc = 0;
8585
memset(&outer, 0, sizeof(outer));
86-
if (ti->id == 83 /* GNU Screen */ && (ti->next || weaken(malloc)) &&
86+
if (ti->id == 83 /* GNU Screen */ && (ti->next || _weaken(malloc)) &&
8787
ttyident_probe(&outer, ttyinfd, ttyoutfd, "\eP\e[>c\e\\") != -1 &&
88-
(ti->next = (ti->next ? ti->next
89-
: weaken(malloc)(sizeof(struct TtyIdent))))) {
88+
(ti->next =
89+
(ti->next ? ti->next
90+
: _weaken(malloc)(sizeof(struct TtyIdent))))) {
9091
memcpy(ti->next, &outer, sizeof(outer));
9192
} else {
9293
free_s(&ti->next);

dsp/tty/sendtitle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
╚─────────────────────────────────────────────────────────────────────────────*/
1919
#include "dsp/tty/tty.h"
2020
#include "libc/mem/arraylist2.internal.h"
21-
#include "libc/runtime/gc.internal.h"
21+
#include "libc/mem/gc.internal.h"
2222
#include "libc/x/x.h"
2323

2424
/* TODO(jart): DELETE */

dsp/tty/ttyraw.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
#include "libc/calls/ucontext.h"
2626
#include "libc/log/log.h"
2727
#include "libc/macros.internal.h"
28-
#include "libc/runtime/gc.internal.h"
28+
#include "libc/mem/gc.internal.h"
2929
#include "libc/runtime/runtime.h"
3030
#include "libc/str/str.h"
3131
#include "libc/sysv/consts/fileno.h"
3232
#include "libc/sysv/consts/sa.h"
3333
#include "libc/sysv/consts/sig.h"
3434
#include "libc/sysv/errfuns.h"
3535
#include "libc/x/x.h"
36+
#include "libc/x/xsigaction.h"
3637

3738
/* TODO(jart): DELETE */
3839

examples/compress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "libc/fmt/conv.h"
1414
#include "libc/log/check.h"
1515
#include "libc/mem/mem.h"
16-
#include "libc/runtime/gc.internal.h"
16+
#include "libc/mem/gc.internal.h"
1717
#include "libc/runtime/runtime.h"
1818
#include "libc/stdio/stdio.h"
1919
#include "libc/str/str.h"

examples/cosh.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
#endif
1010
#include "libc/calls/calls.h"
1111
#include "libc/calls/struct/dirent.h"
12+
#include "libc/calls/struct/rusage.h"
1213
#include "libc/calls/struct/sigaction.h"
1314
#include "libc/calls/struct/sigset.h"
1415
#include "libc/calls/struct/timespec.h"
16+
#include "libc/errno.h"
1517
#include "libc/fmt/fmt.h"
1618
#include "libc/fmt/itoa.h"
19+
#include "libc/log/appendresourcereport.internal.h"
1720
#include "libc/log/internal.h"
1821
#include "libc/log/log.h"
1922
#include "libc/macros.internal.h"
2023
#include "libc/mem/mem.h"
2124
#include "libc/runtime/internal.h"
2225
#include "libc/runtime/runtime.h"
23-
#include "libc/stdio/append.internal.h"
26+
#include "libc/stdio/append.h"
2427
#include "libc/stdio/stdio.h"
2528
#include "libc/str/str.h"
2629
#include "libc/sysv/consts/clock.h"
@@ -151,7 +154,7 @@ int main(int argc, char *argv[]) {
151154
while ((line = linenoiseWithHistory(prompt, "cmd"))) {
152155
n = 0;
153156
start = line;
154-
if (startswith(start, "time ")) {
157+
if (_startswith(start, "time ")) {
155158
timeit = true;
156159
start += 5;
157160
} else {

examples/crashreport2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
╚─────────────────────────────────────────────────────────────────*/
99
#endif
1010
#include "libc/calls/calls.h"
11+
#include "libc/calls/struct/sigset.h"
1112
#include "libc/log/log.h"
1213
#include "libc/stdio/stdio.h"
1314

examples/curl.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
88
╚─────────────────────────────────────────────────────────────────*/
99
#endif
10-
#include "libc/intrin/safemacros.internal.h"
1110
#include "libc/calls/calls.h"
1211
#include "libc/calls/struct/iovec.h"
1312
#include "libc/dce.h"
1413
#include "libc/dns/dns.h"
1514
#include "libc/errno.h"
1615
#include "libc/fmt/conv.h"
1716
#include "libc/fmt/fmt.h"
17+
#include "libc/intrin/safemacros.internal.h"
1818
#include "libc/log/check.h"
1919
#include "libc/log/log.h"
2020
#include "libc/macros.internal.h"
21-
#include "libc/stdio/rand.h"
22-
#include "libc/runtime/gc.h"
21+
#include "libc/mem/gc.h"
2322
#include "libc/runtime/runtime.h"
2423
#include "libc/sock/goodsocket.internal.h"
2524
#include "libc/sock/sock.h"
26-
#include "libc/stdio/append.internal.h"
25+
#include "libc/stdio/append.h"
26+
#include "libc/stdio/rand.h"
2727
#include "libc/stdio/stdio.h"
2828
#include "libc/str/slice.h"
2929
#include "libc/str/str.h"
@@ -40,6 +40,7 @@
4040
#include "libc/sysv/consts/tcp.h"
4141
#include "libc/time/struct/tm.h"
4242
#include "libc/x/x.h"
43+
#include "libc/x/xsigaction.h"
4344
#include "net/http/http.h"
4445
#include "net/http/url.h"
4546
#include "net/https/https.h"

examples/datauri.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
╚─────────────────────────────────────────────────────────────────*/
99
#endif
1010
#include "libc/log/log.h"
11-
#include "libc/runtime/gc.internal.h"
11+
#include "libc/mem/gc.internal.h"
12+
#include "libc/runtime/runtime.h"
1213
#include "libc/stdio/stdio.h"
1314
#include "libc/x/x.h"
1415
#include "net/http/escape.h"

0 commit comments

Comments
 (0)