From 636502de732d7131491da0ff095bd0009ab31171 Mon Sep 17 00:00:00 2001 From: foof Date: Thu, 2 Apr 2009 13:28:31 -0400 Subject: [PATCH] fixing to work on linux --- Makefile | 3 ++- sexp.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e27b1793..4224566f 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ INCDIR=$(PREFIX)/include/chibi-scheme MODDIR=$(PREFIX)/share/chibi-scheme SO=.dylib +LDFLAGS=-lm CFLAGS=-Wall -g -save-temps -Os GC_OBJ=./gc/gc.a @@ -33,7 +34,7 @@ libchibischeme.$(SO): eval.o $(GC_OBJ) gcc $(LDFLAGS) -shared -dynamiclib -o $@ $^ -lchibisexp chibi-scheme: main.o sexp.o $(GC_OBJ) - gcc $(CFLAGS) -o $@ $^ + gcc $(CFLAGS) $(LDFLAGS) -o $@ $^ clean: rm -f *.o *.i *.s diff --git a/sexp.c b/sexp.c index b8974b93..1599c089 100644 --- a/sexp.c +++ b/sexp.c @@ -509,8 +509,8 @@ sexp sexp_make_input_string_port (sexp str) { sexp sexp_make_output_string_port () { FILE *out; sexp buf = sexp_alloc_type(string, SEXP_STRING), res; - out = open_memstream(&sexp_string_data(str), &sexp_string_length(buf)); - res = sexp_make_input_port(in); + out = open_memstream(&sexp_string_data(buf), &sexp_string_length(buf)); + res = sexp_make_input_port(out); sexp_port_cookie(res) = buf; return res; }