BSD fixes Pt.2

This commit is contained in:
Charlie Root 2025-03-22 22:55:20 +00:00
parent 53dad0f47b
commit b5f0ebc258
3 changed files with 7 additions and 6 deletions

View file

@ -3,7 +3,7 @@
OUTNAME = flisp OUTNAME = flisp
CFLAGS = -std=c99 -O0 -Wall -Wextra -g -pipe -Wno-cast-function-type CFLAGS = -std=c99 -O0 -flto -Wall -Wextra -g -pipe -Wno-cast-function-type
CC = gcc CC = gcc

View file

@ -183,7 +183,7 @@ void *get_addr(u32 pos){
return internal_buf + pos; return internal_buf + pos;
} }
Value write(Value a); Value fl_write(Value a);
void print_ast1(Statement *base, i32 indent){ void print_ast1(Statement *base, i32 indent){
i32 close_parent = 1; i32 close_parent = 1;
@ -198,7 +198,7 @@ void print_ast1(Statement *base, i32 indent){
printf("(call<%lx>\n", (u64)base->func); printf("(call<%lx>\n", (u64)base->func);
break; break;
case ST_Const: case ST_Const:
write(base->cons); fl_write(base->cons);
printf("\n"); printf("\n");
close_parent = 0; close_parent = 0;
break; break;
@ -598,7 +598,7 @@ Value pop(Value a, Value b){
} }
Value write(Value a){ Value fl_write(Value a){
char *nstr; char *nstr;
switch(a.tag.type){ switch(a.tag.type){
case T_null: case T_null:
@ -668,7 +668,7 @@ FnSig builtins[] = {
{{tvec} ,1,1,{.bi = BICAST(len)}}, {{tvec} ,1,1,{.bi = BICAST(len)}},
{{tvec,tany},2,1,{.bi = BICAST(push)}}, {{tvec,tany},2,1,{.bi = BICAST(push)}},
{{tvec,tint},2,1,{.bi = BICAST(pop)}}, {{tvec,tint},2,1,{.bi = BICAST(pop)}},
{{tany} ,1,1,{.bi = BICAST(write)}}, {{tany} ,1,1,{.bi = BICAST(fl_write)}},
{{0} ,0,1,{.bi = BICAST(nwline)}} {{0} ,0,1,{.bi = BICAST(nwline)}}
}; };

View file

@ -20,6 +20,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include "types.h" #include "types.h"
#include "tests.h" #include "tests.h"