From fa7ef40c42c30807395ab3fe5019e04928102a20 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 27 Feb 2014 20:07:56 -0500 Subject: Now that I have a working Mac OS X setup, added the initial groundwork for the OS X port. This C file works correctly on both amd64 and i386 with clang [-m32] runtimetest.c -lobjc -framework Foundation; it will be converted to Go now. --- darwintest/runtimetest.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 darwintest/runtimetest.c diff --git a/darwintest/runtimetest.c b/darwintest/runtimetest.c new file mode 100644 index 0000000..c0109d3 --- /dev/null +++ b/darwintest/runtimetest.c @@ -0,0 +1,22 @@ +// 27 february 2014 +#include +#include +#include +#include + +int main(void) +{ + id NSString = objc_getClass("NSString"); + SEL stringFromUTF8String = + sel_getUid("stringWithUTF8String:"); + id str = objc_msgSend(NSString, + stringFromUTF8String, + "hello, world\n"); + SEL UTF8String = + sel_getUid("UTF8String"); + + printf("%s", + (char *) objc_msgSend(str, + UTF8String)); + return 0; +} -- cgit v1.2.3