Fold conv package into fmt

Both packages had nearly identical dependency requirements, so merging
them should help reduce the complexity of the build graph.
main
Justine Tunney 2020-12-09 15:04:54 -08:00
parent 978b7858f9
commit 1fc91f3580
203 changed files with 352 additions and 563 deletions

View File

@ -104,7 +104,6 @@ include ape/lib/apelib.mk # │
include ape/ape.mk #─┘
include libc/sysv/sysv.mk #─┐
include libc/nt/nt.mk # ├──system
include libc/conv/conv.mk # │
include libc/fmt/fmt.mk # │
include libc/rand/rand.mk #─┘
include libc/calls/calls.mk #─┐
@ -186,7 +185,6 @@ include test/libc/dns/test.mk
include test/libc/rand/test.mk
include test/libc/time/test.mk
include test/libc/stdio/test.mk
include test/libc/conv/test.mk
include test/libc/release/test.mk
include test/libc/test.mk
include test/ape/lib/test.mk
@ -251,7 +249,6 @@ COSMOPOLITAN_OBJECTS = \
LIBC_BITS \
LIBC_CALLS \
LIBC_CALLS_HEFTY \
LIBC_CONV \
LIBC_CRYPTO \
LIBC_DNS \
LIBC_ELF \
@ -286,7 +283,6 @@ COSMOPOLITAN_HEADERS = \
LIBC_ALG \
LIBC_BITS \
LIBC_CALLS \
LIBC_CONV \
LIBC_CRYPTO \
LIBC_DNS \
LIBC_ELF \

View File

@ -33,7 +33,7 @@
#include "dsp/mpeg/mpeg.h"
#include "dsp/mpeg/video.h"
#include "libc/bits/initializer.internal.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/log/log.h"
#include "libc/macros.h"
#include "libc/math.h"

View File

@ -9,8 +9,8 @@
#endif
#include "libc/calls/calls.h"
#include "libc/calls/hefty/copyfile.h"
#include "libc/conv/conv.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/fmt.h"
#include "libc/runtime/gc.h"
#include "libc/runtime/runtime.h"

View File

@ -46,7 +46,6 @@ EXAMPLES_DIRECTDEPS = \
LIBC_BITS \
LIBC_CALLS \
LIBC_CALLS_HEFTY \
LIBC_CONV \
LIBC_FMT \
LIBC_LOG \
LIBC_LOG_ASAN \

View File

@ -10,7 +10,7 @@
#include "libc/bits/bits.h"
#include "libc/calls/calls.h"
#include "libc/calls/struct/itimerval.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/limits.h"
#include "libc/log/check.h"
#include "libc/log/color.internal.h"

View File

@ -12,7 +12,7 @@
#include "libc/alg/critbit0.h"
#include "libc/bits/bits.h"
#include "libc/calls/calls.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/log/check.h"
#include "libc/log/log.h"
#include "libc/macros.h"

View File

@ -18,8 +18,8 @@
#include "libc/calls/hefty/spawn.h"
#include "libc/calls/struct/itimerval.h"
#include "libc/calls/struct/winsize.h"
#include "libc/conv/conv.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/fmt.h"
#include "libc/inttypes.h"
#include "libc/log/check.h"

View File

@ -17,14 +17,16 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/runtime/interruptiblecall.h"
#include "libc/stdio/stdio.h"
#include "libc/sysv/consts/sig.h"
struct InterruptibleCall icall;
static intptr_t peek(intptr_t *addr) { return *addr; }
static intptr_t peek(intptr_t *addr) {
return *addr;
}
int main(int argc, char *argv[]) {
int i;

View File

@ -7,7 +7,7 @@
http://creativecommons.org/publicdomain/zero/1.0/ │
*/
#endif
#include "libc/conv/itoa.h"
#include "libc/fmt/itoa.h"
#include "libc/math.h"
#include "libc/stdio/stdio.h"

View File

@ -10,7 +10,7 @@
#include "libc/alg/alg.h"
#include "libc/calls/calls.h"
#include "libc/calls/hefty/spawn.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/limits.h"
#include "libc/log/check.h"
#include "libc/runtime/gc.h"

View File

@ -120,9 +120,9 @@
#include "libc/calls/struct/stat.h"
#include "libc/calls/struct/tms.h"
#include "libc/calls/termios.h"
#include "libc/conv/conv.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/fmt.h"
#include "libc/limits.h"
#include "libc/log/log.h"

View File

@ -17,7 +17,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
int(abs)(int x) { return ABS(x); }
int(abs)(int x) {
return ABS(x);
}

View File

@ -39,15 +39,14 @@ LIBC_CALLS_A_CHECKS = \
LIBC_CALLS_A_DIRECTDEPS = \
LIBC_FMT \
LIBC_STR \
LIBC_RAND \
LIBC_CONV \
LIBC_STUBS \
LIBC_NEXGEN32E \
LIBC_NT_NTDLL \
LIBC_NT_ADVAPI32 \
LIBC_NT_KERNEL32 \
LIBC_NT_KERNELBASE \
LIBC_NT_NTDLL \
LIBC_RAND \
LIBC_STR \
LIBC_STUBS \
LIBC_SYSV_CALLS \
LIBC_SYSV

View File

@ -23,8 +23,8 @@
#include "libc/calls/internal.h"
#include "libc/calls/struct/timespec.h"
#include "libc/calls/struct/timeval.h"
#include "libc/conv/conv.h"
#include "libc/dce.h"
#include "libc/fmt/conv.h"
#include "libc/mach.h"
#include "libc/nt/struct/filetime.h"
#include "libc/nt/struct/systemtime.h"

View File

@ -20,9 +20,9 @@
#include "libc/bits/progn.internal.h"
#include "libc/bits/safemacros.internal.h"
#include "libc/calls/calls.h"
#include "libc/conv/conv.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/nt/ntdll.h"
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"

View File

@ -20,7 +20,7 @@
#include "libc/bits/safemacros.internal.h"
#include "libc/calls/internal.h"
#include "libc/calls/struct/stat.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/nt/enum/fileflagandattributes.h"
#include "libc/nt/enum/fileinfobyhandleclass.h"
#include "libc/nt/enum/filetype.h"

View File

@ -21,7 +21,7 @@
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/kntprioritycombos.internal.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/nexgen32e/ffs.h"
#include "libc/nt/enum/processcreationflags.h"
#include "libc/nt/enum/threadpriority.h"

View File

@ -20,7 +20,7 @@
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/struct/rusage.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/nt/accounting.h"
#include "libc/nt/runtime.h"
#include "libc/nt/thread.h"

View File

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/calls/calls.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/sysv/consts/prio.h"
#include "libc/sysv/errfuns.h"

View File

@ -19,7 +19,7 @@
*/
#include "libc/calls/internal.h"
#include "libc/calls/struct/timeval.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/nt/struct/filetime.h"
#include "libc/nt/struct/systemtime.h"
#include "libc/nt/synchronization.h"

View File

@ -22,7 +22,7 @@
#include "libc/calls/hefty/ntspawn.h"
#include "libc/calls/hefty/spawn.h"
#include "libc/calls/internal.h"
#include "libc/conv/itoa.h"
#include "libc/fmt/itoa.h"
#include "libc/nt/enum/filemapflags.h"
#include "libc/nt/enum/pageflags.h"
#include "libc/nt/enum/startf.h"

View File

@ -37,7 +37,6 @@ LIBC_CALLS_HEFTY_A_CHECKS = \
LIBC_CALLS_HEFTY_A_DIRECTDEPS = \
LIBC_ALG \
LIBC_CALLS \
LIBC_CONV \
LIBC_FMT \
LIBC_MEM \
LIBC_NEXGEN32E \

View File

@ -20,7 +20,7 @@
#include "libc/alg/arraylist2.internal.h"
#include "libc/calls/calls.h"
#include "libc/calls/hefty/ntspawn.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/hascharacter.internal.h"

View File

@ -19,7 +19,7 @@
*/
#include "libc/alg/arraylist2.internal.h"
#include "libc/calls/hefty/ntspawn.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
#include "libc/mem/mem.h"
#include "libc/str/oldutf16.internal.h"

View File

@ -24,7 +24,7 @@
#include "libc/calls/calls.h"
#include "libc/calls/hefty/ntspawn.h"
#include "libc/calls/internal.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/nt/enum/processcreationflags.h"
#include "libc/nt/process.h"
#include "libc/nt/runtime.h"

View File

@ -22,8 +22,8 @@
#include "libc/calls/hefty/internal.h"
#include "libc/calls/hefty/spawn.h"
#include "libc/calls/internal.h"
#include "libc/conv/conv.h"
#include "libc/dce.h"
#include "libc/fmt/conv.h"
#include "libc/mem/mem.h"
#include "libc/paths.h"
#include "libc/runtime/runtime.h"

View File

@ -21,8 +21,8 @@
#include "libc/bits/safemacros.internal.h"
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/conv/conv.h"
#include "libc/dce.h"
#include "libc/fmt/conv.h"
#include "libc/log/log.h"
#include "libc/nexgen32e/vendor.internal.h"
#include "libc/nt/struct/teb.h"

View File

@ -19,7 +19,7 @@
*/
#include "libc/bits/safemacros.internal.h"
#include "libc/calls/calls.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/sysv/consts/prio.h"
static int clamp(int p) {

View File

@ -20,10 +20,10 @@
#include "libc/assert.h"
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/conv/conv.h"
#include "libc/conv/isslash.internal.h"
#include "libc/conv/itoa.h"
#include "libc/dce.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/isslash.internal.h"
#include "libc/fmt/itoa.h"
#include "libc/nt/createfile.h"
#include "libc/nt/enum/accessmask.h"
#include "libc/nt/enum/creationdisposition.h"

View File

@ -20,8 +20,8 @@
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/struct/itimerval.h"
#include "libc/conv/conv.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/log/check.h"
#include "libc/nexgen32e/nexgen32e.h"
#include "libc/nt/files.h"

View File

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/calls/internal.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/nt/createfile.h"
#include "libc/nt/enum/accessmask.h"
#include "libc/nt/enum/creationdisposition.h"

View File

@ -20,7 +20,7 @@
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
#include "libc/calls/struct/rusage.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
#include "libc/nt/accounting.h"
#include "libc/nt/enum/status.h"

View File

@ -1,85 +0,0 @@
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
#
# SYNOPSIS
#
# Cosmopolitan Data Conversions
#
# DESCRIPTION
#
# This package provides functions that convert between data types.
# It's intended to be lower level than the memory and formatting
# libraries.
PKGS += LIBC_CONV
LIBC_CONV_ARTIFACTS += LIBC_CONV_A
LIBC_CONV = $(LIBC_CONV_A_DEPS) $(LIBC_CONV_A)
LIBC_CONV_A = o/$(MODE)/libc/conv/conv.a
LIBC_CONV_A_FILES := $(wildcard libc/conv/*)
LIBC_CONV_A_HDRS = $(filter %.h,$(LIBC_CONV_A_FILES))
LIBC_CONV_A_SRCS_S = $(filter %.S,$(LIBC_CONV_A_FILES))
LIBC_CONV_A_SRCS_C = $(filter %.c,$(LIBC_CONV_A_FILES))
LIBC_CONV_A_SRCS = \
$(LIBC_CONV_A_SRCS_S) \
$(LIBC_CONV_A_SRCS_C)
LIBC_CONV_A_OBJS = \
$(LIBC_CONV_A_SRCS:%=o/$(MODE)/%.zip.o) \
$(LIBC_CONV_A_SRCS_S:%.S=o/$(MODE)/%.o) \
$(LIBC_CONV_A_SRCS_C:%.c=o/$(MODE)/%.o)
LIBC_CONV_A_CHECKS = \
$(LIBC_CONV_A).pkg \
$(LIBC_CONV_A_HDRS:%=o/$(MODE)/%.ok)
LIBC_CONV_A_DIRECTDEPS = \
LIBC_NEXGEN32E \
LIBC_STUBS \
LIBC_STR \
LIBC_TINYMATH \
LIBC_SYSV \
THIRD_PARTY_COMPILER_RT
LIBC_CONV_A_DEPS := \
$(call uniq,$(foreach x,$(LIBC_CONV_A_DIRECTDEPS),$($(x))))
$(LIBC_CONV_A): libc/conv/ \
$(LIBC_CONV_A).pkg \
$(LIBC_CONV_A_OBJS)
$(LIBC_CONV_A).pkg: \
$(LIBC_CONV_A_OBJS) \
$(foreach x,$(LIBC_CONV_A_DIRECTDEPS),$($(x)_A).pkg)
o/$(MODE)/libc/conv/dosdatetimetounix.o \
o/$(MODE)/libc/conv/itoa64radix10.greg.o \
o/$(MODE)/libc/conv/timetofiletime.o \
o/$(MODE)/libc/conv/filetimetotime.o \
o/$(MODE)/libc/conv/timespectofiletime.o \
o/$(MODE)/libc/conv/filetimetotimespec.o \
o/$(MODE)/libc/conv/filetimetotimeval.o: \
OVERRIDE_CFLAGS += \
-O3
o/$(MODE)/libc/conv/itoa64radix10.greg.o \
o/$(MODE)/libc/conv/itoa128radix10.greg.o: \
OVERRIDE_CFLAGS += \
-fwrapv
$(LIBC_CONV_A_OBJS): \
OVERRIDE_CFLAGS += \
$(NO_MAGIC)
LIBC_CONV_LIBS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)))
LIBC_CONV_SRCS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_SRCS))
LIBC_CONV_HDRS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_HDRS))
LIBC_CONV_BINS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_BINS))
LIBC_CONV_CHECKS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_CHECKS))
LIBC_CONV_OBJS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_OBJS))
LIBC_CONV_TESTS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_TESTS))
$(LIBC_CONV_OBJS): $(BUILD_FILES) libc/conv/conv.mk
.PHONY: o/$(MODE)/libc/conv
o/$(MODE)/libc/conv: $(LIBC_CONV_CHECKS)

View File

@ -1,8 +0,0 @@
#ifndef COSMOPOLITAN_LIBC_CONV_ISSLASH_H_
#define COSMOPOLITAN_LIBC_CONV_ISSLASH_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
forceinline bool isslash(int c) { return c == '/' || c == '\\'; }
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_CONV_ISSLASH_H_ */

View File

@ -19,10 +19,10 @@
*/
#include "libc/bits/safemacros.internal.h"
#include "libc/calls/calls.h"
#include "libc/conv/conv.h"
#include "libc/dns/dns.h"
#include "libc/dns/hoststxt.h"
#include "libc/dns/resolvconf.h"
#include "libc/fmt/conv.h"
#include "libc/mem/mem.h"
#include "libc/sock/sock.h"
#include "libc/str/str.h"

View File

@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
int(abs)(int x) {
return 0 < x ? x : -x;

View File

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/conv/strlol.internal.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/strlol.internal.h"
#include "libc/limits.h"
/**

View File

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/conv/strlol.internal.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/strlol.internal.h"
#include "libc/limits.h"
long atol(const char *s) {

View File

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/conv/strlol.internal.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/strlol.internal.h"
#include "libc/limits.h"
long long atoll(const char *s) {

View File

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/conv/isslash.internal.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/isslash.internal.h"
#include "libc/str/str.h"
/**

View File

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/conv/isslash.internal.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/isslash.internal.h"
/**
* Returns pointer to last filename component in path.

View File

@ -1,5 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_CONV_CONV_H_
#define COSMOPOLITAN_LIBC_CONV_CONV_H_
#ifndef COSMOPOLITAN_LIBC_FMT_CONV_H_
#define COSMOPOLITAN_LIBC_FMT_CONV_H_
#include "libc/calls/struct/timespec.h"
#include "libc/calls/struct/timeval.h"
#include "libc/nt/struct/filetime.h"
@ -103,4 +103,4 @@ intmax_t __imaxabs(intmax_t) libcesque pureconst;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_CONV_CONV_H_ */
#endif /* COSMOPOLITAN_LIBC_FMT_CONV_H_ */

View File

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/calls/struct/timeval.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/time/time.h"
long convertmicros(const struct timeval *tv, long tick) {

View File

@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/str/str.h"
#define ISDELIM(c) (c == '/' || c == '\\' || c == '.')

View File

@ -17,6 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
div_t(div)(int num, int den) { return div(num, den); }
div_t(div)(int num, int den) {
return div(num, den);
}

View File

@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
#include "libc/time/time.h"

View File

@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/nt/struct/filetime.h"
int64_t filetimetotime(struct NtFileTime ft) {

View File

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/calls/calls.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/nt/struct/filetime.h"
/**

View File

@ -19,7 +19,7 @@
*/
#include "libc/calls/calls.h"
#include "libc/calls/struct/timeval.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/nt/struct/filetime.h"
void FileTimeToTimeVal(struct timeval *tv, struct NtFileTime ft) {

View File

@ -34,12 +34,12 @@ LIBC_FMT_A_CHECKS = \
$(LIBC_FMT_A_HDRS:%=o/$(MODE)/%.ok)
LIBC_FMT_A_DIRECTDEPS = \
LIBC_STUBS \
LIBC_STR \
LIBC_TINYMATH \
LIBC_NEXGEN32E \
LIBC_NT_KERNELBASE \
LIBC_STR \
LIBC_STUBS \
LIBC_SYSV \
LIBC_TINYMATH \
THIRD_PARTY_COMPILER_RT
LIBC_FMT_A_DEPS := \
@ -57,6 +57,21 @@ $(LIBC_FMT_A_OBJS): \
OVERRIDE_CFLAGS += \
-fno-jump-tables
o/$(MODE)/libc/fmt/dosdatetimetounix.o \
o/$(MODE)/libc/fmt/itoa64radix10.greg.o \
o/$(MODE)/libc/fmt/timetofiletime.o \
o/$(MODE)/libc/fmt/filetimetotime.o \
o/$(MODE)/libc/fmt/timespectofiletime.o \
o/$(MODE)/libc/fmt/filetimetotimespec.o \
o/$(MODE)/libc/fmt/filetimetotimeval.o: \
OVERRIDE_CFLAGS += \
-O3
o/$(MODE)/libc/fmt/itoa64radix10.greg.o \
o/$(MODE)/libc/fmt/itoa128radix10.greg.o: \
OVERRIDE_CFLAGS += \
-fwrapv
LIBC_FMT_LIBS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)))
LIBC_FMT_SRCS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)_SRCS))
LIBC_FMT_HDRS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)_HDRS))

View File

@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
intmax_t(imaxabs)(intmax_t x) {

View File

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/conv/isslash.internal.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/isslash.internal.h"
/**
* Returns true if pathname could be absolute on any known platform.

View File

@ -0,0 +1,10 @@
#ifndef COSMOPOLITAN_LIBC_FMT_ISSLASH_H_
#define COSMOPOLITAN_LIBC_FMT_ISSLASH_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
forceinline bool isslash(int c) {
return c == '/' || c == '\\';
}
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_FMT_ISSLASH_H_ */

View File

@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/fmt.h"
STATIC_YOINK("ntoa");

View File

@ -1,5 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_CONV_ITOA_H_
#define COSMOPOLITAN_LIBC_CONV_ITOA_H_
#ifndef COSMOPOLITAN_LIBC_FMT_ITOA_H_
#define COSMOPOLITAN_LIBC_FMT_ITOA_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
/*───────────────────────────────────────────────────────────────────────────│─╗
@ -29,4 +29,4 @@ size_t uint128toarray_radix10(uint128_t, char *);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_CONV_ITOA_H_ */
#endif /* COSMOPOLITAN_LIBC_FMT_ITOA_H_ */

View File

@ -18,8 +18,8 @@
02110-1301 USA
*/
#include "libc/alg/reverse.h"
#include "libc/conv/conv.h"
#include "libc/conv/itoa.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/itoa.h"
#include "libc/limits.h"
uint128_t __udivmodti4(uint128_t, uint128_t, uint128_t *);

View File

@ -18,8 +18,8 @@
02110-1301 USA
*/
#include "libc/alg/reverse.h"
#include "libc/conv/conv.h"
#include "libc/conv/itoa.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/itoa.h"
noinline size_t uint64toarray(uint64_t i, char *a, int r) {
size_t j;

View File

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/assert.h"
#include "libc/conv/itoa.h"
#include "libc/fmt/itoa.h"
size_t uint64toarray_fixed16(uint64_t x, char b[hasatleast 17], uint8_t k) {
int i;

View File

@ -18,8 +18,8 @@
02110-1301 USA
*/
#include "libc/alg/reverse.h"
#include "libc/conv/conv.h"
#include "libc/conv/itoa.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/itoa.h"
#include "libc/limits.h"
/**

View File

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/conv/itoa.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/itoa.h"
#include "libc/macros.h"
#include "libc/nexgen32e/bsr.h"

View File

@ -18,8 +18,8 @@
02110-1301 USA
*/
#include "libc/alg/reverse.h"
#include "libc/conv/conv.h"
#include "libc/conv/itoa.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/itoa.h"
#include "libc/limits.h"
/**

View File

@ -17,7 +17,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
long(labs)(long x) { return ABS(x); }
long(labs)(long x) {
return ABS(x);
}

View File

@ -17,6 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
ldiv_t(ldiv)(long num, long den) { return ldiv(num, den); }
ldiv_t(ldiv)(long num, long den) {
return ldiv(num, den);
}

View File

@ -17,7 +17,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
long long(llabs)(long long x) { return ABS(x); }
long long(llabs)(long long x) {
return ABS(x);
}

View File

@ -17,6 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
lldiv_t(lldiv)(long long num, long long den) { return lldiv(num, den); }
lldiv_t(lldiv)(long long num, long long den) {
return lldiv(num, den);
}

View File

@ -18,7 +18,7 @@
02110-1301 USA
*/
#include "libc/bits/bits.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
char *ltpcpy(char *dst, long x) {
unsigned len = llog10(abs(x)) + 1;

View File

@ -25,7 +25,7 @@
THE SOFTWARE.
*/
#include "libc/assert.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/paland.inc"
#include "libc/fmt/palandprintf.internal.h"

View File

@ -38,7 +38,7 @@
#include "libc/assert.h"
#include "libc/bits/bits.h"
#include "libc/bits/weaken.h"
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/fmt.h"
#include "libc/fmt/paland.inc"
#include "libc/fmt/palandprintf.internal.h"

View File

@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/math.h"
double RoundDecimalPlaces(double f, double digs, double rounder(double)) {

View File

@ -17,7 +17,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/fmt/conv.h"
#include "libc/limits.h"
#include "libc/nexgen32e/bsr.h"
#include "libc/str/str.h"

View File

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "libc/conv/conv.h"
#include "libc/conv/strlol.internal.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/strlol.internal.h"
#include "libc/limits.h"
/**

View File

@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA