From 320a99b59ec32b8db6436982856116da1884d131 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Fri, 13 Mar 2020 18:21:05 -0400 Subject: fixed various build problems --- build.sh | 2 +- foreign.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index ca452e4..4c26cc7 100755 --- a/build.sh +++ b/build.sh @@ -29,7 +29,7 @@ if [ "$COMPILE_TIME_FOREIGN_FN_SUPPORT" != "no" ]; then if uname | grep -qi bsd; then LIBRARIES='-lavcall' else - LIBRARIES='-ldl -lffcall' + LIBRARIES='-ldl -lavcall' fi ADDITIONAL_FLAGS="$ADDITIONAL_FLAGS -DCOMPILE_TIME_FOREIGN_FN_SUPPORT=1 $LIBRARIES" fi diff --git a/foreign.c b/foreign.c index 647a182..ef028ba 100644 --- a/foreign.c +++ b/foreign.c @@ -287,7 +287,6 @@ static void ffmgr_create(ForeignFnManager *ffmgr, Allocator *allocr) { str_hash_table_create(&ffmgr->libs_loaded, sizeof(Library), allocr); } -/* args must be a dynamic array. */ static bool foreign_call(ForeignFnManager *ffmgr, FnExpr *fn, Type *ret_type, Type *arg_types, size_t arg_types_stride, Value *args, size_t nargs, Location call_where, Value *ret) { void (*fn_ptr)() = fn->foreign.fn_ptr; if (!fn_ptr) { @@ -344,8 +343,8 @@ static void ffmgr_create(ForeignFnManager *ffmgr, Allocator *allocr) { (void)allocr; } -static bool foreign_call(ForeignFnManager *ffmgr, FnExpr *fn, Type *fn_type, Value *args, Location call_where, Value *ret) { - (void)ffmgr; (void)fn; (void)fn_type; (void)args; (void)ret; +static bool foreign_call(ForeignFnManager *ffmgr, FnExpr *fn, Type *ret_type, Type *arg_types, size_t arg_types_stride, Value *args, size_t nargs, Location call_where, Value *ret) { + (void)ffmgr; (void)fn; (void)ret_type; (void)arg_types; (void)arg_types_stride; (void)args; (void)nargs; (void)ret; err_print(call_where, "You have not compiled toc with compile time foreign function support."); return false; } -- cgit v1.2.3