diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-05-08 17:00:35 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-05-08 17:00:35 -0400 |
commit | 6886389e7c55b382545026b668dd400949edf337 (patch) | |
tree | 91c110711fe9217535e42b4f893b5a2dba91f451 | |
parent | 270ce8372aeddaa3f10362f88473ceb1159b9b5f (diff) |
oops fixed putf
-rwxr-xr-x | build.sh | 8 | ||||
-rw-r--r-- | std/io.toc | 2 | ||||
-rw-r--r-- | test.toc | 8 |
3 files changed, 9 insertions, 9 deletions
@@ -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" @@ -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); @@ -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(); |