From 0f227ac6f824d9e171fa06b70c3461c4c011fd20 Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Thu, 23 Sep 2021 08:29:52 -0500 Subject: [PATCH] Add a function to add primitives in the test library --- test/c/ffi_test.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/c/ffi_test.c b/test/c/ffi_test.c index e9cb42b..4d9d520 100644 --- a/test/c/ffi_test.c +++ b/test/c/ffi_test.c @@ -1,5 +1,9 @@ #include +int add_numbers(int a, int b) { + return a + b; +} + typedef struct point { float x; float y; @@ -18,7 +22,7 @@ typedef char *CString; typedef CString (*StringFactory)(void); -void upcall_test(StringFactory fun) { +CString upcall_test(StringFactory fun) { return fun(); }