Add msgSend1Id wrapper method for msgSend

This commit is contained in:
Brian Anderson
2012-04-18 19:14:58 -07:00
parent da80902a00
commit 0f0f4aeff3
5 changed files with 33 additions and 4 deletions
+1
View File
@@ -1,6 +1,7 @@
*~
*#
*.o
*.a
*.so
*.dylib
*.dSYM
+11 -3
View File
@@ -1,4 +1,6 @@
CC ?= gcc
RUSTC ?= rustc
AR ?= ar
RUSTFLAGS ?=
RUST_SRC = $(shell find . -type f -name '*.rs')
@@ -6,16 +8,22 @@ RUST_SRC = $(shell find . -type f -name '*.rs')
.PHONY: all
all: libcocoa.dummy
libcocoa.dummy: cocoa.rc $(RUST_SRC)
libcocoa.dummy: cocoa.rc $(RUST_SRC) libmsgsend.a
$(RUSTC) $(RUSTFLAGS) $< -o $@
touch $@
cocoa-test: cocoa.rc $(RUST_SRC)
cocoa-test: cocoa.rc $(RUST_SRC) libmsgsend.a
$(RUSTC) $(RUSTFLAGS) $< -o $@ --test
libmsgsend.a: msgsend.o
$(AR) rcs libmsgsend.a msgsend.o
msgsend.o: msgsend.c
$(CC) $< -o $@ -c
check: cocoa-test
./cocoa-test
.PHONY: clean
clean:
rm -f cocoa-test *.so *.dylib *.dll *.dummy
rm -f cocoa-test *.a *.o *.so *.dylib *.dll *.dummy
-1
View File
@@ -12,4 +12,3 @@ use std;
mod appkit;
mod base;
mod foundation;
+10
View File
@@ -0,0 +1,10 @@
fn msgSend1Id(theReceiver: base::id, theSelector: base::SEL, id: base::id) {
msgsend::msgSend1IdHACK(theReceiver, theSelector, id);
}
#[link_args = "-L . -lmsgsend"]
#[nolink]
native mod msgsend {
fn msgSend1IdHACK(theReceiver: base::id, theSelector: base::SEL, id: base::id);
}
+11
View File
@@ -0,0 +1,11 @@
#include <stdint.h>
#include <objc/message.h>
void
msgSend1IdHACK(id theReceiver, SEL theSender, id id) {
printf("msgSend1IdHACK\n");
printf("%ld\n", theReceiver);
printf("%ld\n", theSender);
printf("%ld\n", id);
objc_msgSend(theReceiver, theSender, id);
}