From 379662314749592a57a44297ef65282e685f7a17 Mon Sep 17 00:00:00 2001 From: bel Date: Fri, 17 Nov 2023 19:47:34 -0700 Subject: [PATCH] maybe --- c.d/helloworld.c | 4 ++-- c.d/helloworld.def | 3 +++ c.d/helloworld.h | 2 ++ c.d/run.sh | 9 +++++++-- 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 c.d/helloworld.def diff --git a/c.d/helloworld.c b/c.d/helloworld.c index 0a8f557..94433b0 100644 --- a/c.d/helloworld.c +++ b/c.d/helloworld.c @@ -1,5 +1,5 @@ #include "helloworld.h" -void main() { - printf("hello world\n"); +int foo() { + return 0; } diff --git a/c.d/helloworld.def b/c.d/helloworld.def new file mode 100644 index 0000000..d8d4f4c --- /dev/null +++ b/c.d/helloworld.def @@ -0,0 +1,3 @@ +headers = helloworld.h +headerFilter = helloworld.h +package = helloworld diff --git a/c.d/helloworld.h b/c.d/helloworld.h index 53c5fdf..bd8db16 100644 --- a/c.d/helloworld.h +++ b/c.d/helloworld.h @@ -1 +1,3 @@ #include + +int foo(); diff --git a/c.d/run.sh b/c.d/run.sh index 80e39ba..b11e4c3 100644 --- a/c.d/run.sh +++ b/c.d/run.sh @@ -4,5 +4,10 @@ set -e set -o pipefail set -u -gcc ./*.{h,c} -./a.out +echo GCC +echo gcc ./*.{h,c} + +echo CINTEROP +cinterop -def helloworld.def -compiler-option -I. -o helloworld +echo LS +ls ./helloworld.klib ./helloworld-build/kotlin