From 6886389e7c55b382545026b668dd400949edf337 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Fri, 8 May 2020 17:00:35 -0400 Subject: oops fixed putf --- build.sh | 8 +++++--- std/io.toc | 2 +- test.toc | 8 +++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 3d5e605..17eaf9f 100755 --- a/build.sh +++ b/build.sh @@ -30,7 +30,7 @@ else fi [ "$ARCH" = "" ] && ARCH="$(uname -m)" - +[ "$ARCH" = "amd64" ] && ARCH=x86_64 if [ "$COMPILE_TIME_FOREIGN_FN_SUPPORT" != "no" ]; then uname | grep -qi bsd || LIBRARIES="$LIBRARIES -ldl" @@ -59,6 +59,8 @@ c() { echo "$1" && $1 || exit 1 } -[ ! -f systemv64call.o ] && c "$NASM -f elf64 systemv64call.asm" -c "$CC $FLAGS -o toc main.c systemv64call.o" +[ "$ARCH" = "x86_64" ] && [ ! -f systemv64call.o ] && c "$NASM -f elf64 systemv64call.asm" +SOURCES=main.c +[ "$ARCH" = "x86_64" ] && SOURCES="$SOURCES systemv64call.o" +c "$CC $FLAGS -o toc $SOURCES" diff --git a/std/io.toc b/std/io.toc index 4eaf113..71ff009 100644 --- a/std/io.toc +++ b/std/io.toc @@ -53,7 +53,7 @@ puti ::= fn(x: int) { writef ::= fn(x: float) { fmt := "%f\0"; - printf(&fmt[0], x); + printf(&fmt[0], x as f64); } putf ::= fn(x: float) { writef(x); diff --git a/test.toc b/test.toc index 6c66a8b..da48b5c 100644 --- a/test.toc +++ b/test.toc @@ -1,9 +1,7 @@ #include "std/io.toc", io; +#include "std/base.toc", base; main ::= fn() { - #warn("foo"); #no_warn - x := 0 as ∫ #no_warn - #warn("foo"); #no_warn - #warn("foo"); #no_warn - #warn("foo"); #no_warn + io.putf(3.7); } +main(); -- cgit v1.2.3