Add msgSend1Id wrapper method for msgSend
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
*~
|
||||
*#
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
*.dylib
|
||||
*.dSYM
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user