diff options
Diffstat (limited to 'examples/objciface/gnustepex.nim')
-rw-r--r-- | examples/objciface/gnustepex.nim | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/examples/objciface/gnustepex.nim b/examples/objciface/gnustepex.nim deleted file mode 100644 index d961d3087..000000000 --- a/examples/objciface/gnustepex.nim +++ /dev/null @@ -1,40 +0,0 @@ -# horrible example of how to interface with GNUStep ... - -{.passL: "-lobjc".} -{.emit: """ - -#include <objc/Object.h> - -@interface Greeter:Object -{ -} - -- (void)greet:(long)x y:(long)dummy; - -@end - -#include <stdio.h> - -@implementation Greeter - -- (void)greet:(long)x y:(long)dummy -{ - printf("Hello, World!\n"); -} - -@end - -#include <stdlib.h> -""".} - -type - TId {.importc: "id", header: "<objc/Object.h>", final.} = distinct int - -proc newGreeter: TId {.importobjc: "Greeter new", nodecl.} -proc greet(self: TId, x, y: int) {.importobjc: "greet", nodecl.} -proc free(self: TId) {.importobjc: "free", nodecl.} - -var g = newGreeter() -g.greet(12, 34) -g.free() - |