mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 10:48:29 +00:00
parent
95f54eeb40
commit
c1d99676c4
1421 changed files with 5556 additions and 2198 deletions
2
third_party/make/error.c
vendored
2
third_party/make/error.c
vendored
|
@ -25,8 +25,6 @@
|
|||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "third_party/make/stdio.h"
|
||||
|
||||
#if !_LIBC && ENABLE_NLS
|
||||
|
|
19
third_party/make/hash.c
vendored
19
third_party/make/hash.c
vendored
|
@ -414,6 +414,24 @@ jhash(unsigned const char *k, int length)
|
|||
|
||||
#define UINTSZ sizeof (unsigned int)
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
/* The ifs are ordered from the first byte in memory to the last. */
|
||||
#define sum_up_to_nul(r, p, plen, flag) \
|
||||
do { \
|
||||
unsigned int val = 0; \
|
||||
size_t pn = (plen); \
|
||||
size_t n = pn < UINTSZ ? pn : UINTSZ; \
|
||||
memcpy (&val, (p), n); \
|
||||
if ((val & 0xFF000000) == 0) \
|
||||
flag = 1; \
|
||||
else if ((val & 0xFF0000) == 0) \
|
||||
r += val & ~0xFFFF, flag = 1; \
|
||||
else if ((val & 0xFF00) == 0) \
|
||||
r += val & ~0xFF, flag = 1; \
|
||||
else \
|
||||
r += val, flag = (val & 0xFF) == 0; \
|
||||
} while (0)
|
||||
#else
|
||||
/* First detect the presence of zeroes. If there is none, we can
|
||||
sum the 4 bytes directly. Otherwise, the ifs are ordered as in the
|
||||
big endian case, from the first byte in memory to the last. */
|
||||
|
@ -436,6 +454,7 @@ jhash(unsigned const char *k, int length)
|
|||
r += val; \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
unsigned int
|
||||
jhash_string(unsigned const char *k)
|
||||
|
|
3
third_party/make/make.mk
vendored
3
third_party/make/make.mk
vendored
|
@ -74,6 +74,8 @@ THIRD_PARTY_MAKE_SRCS_LIB = \
|
|||
third_party/make/xmalloc.c
|
||||
|
||||
THIRD_PARTY_MAKE_SRCS_BASE = \
|
||||
third_party/make/ar.c \
|
||||
third_party/make/arscan.c \
|
||||
third_party/make/commands.c \
|
||||
third_party/make/default.c \
|
||||
third_party/make/dir.c \
|
||||
|
@ -162,7 +164,6 @@ o/$(MODE)/third_party/make/hash.o: \
|
|||
|
||||
$(THIRD_PARTY_MAKE_OBJS): \
|
||||
OVERRIDE_CFLAGS += \
|
||||
-DNO_ARCHIVES \
|
||||
-DSTACK_FRAME_UNLIMITED \
|
||||
-DHAVE_CONFIG_H \
|
||||
-DINCLUDEDIR=\".\" \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue