Skip to content

Commit 61d41d8

Browse files
committed
MacOS: ignore functions marked as arm64 unavailable
1 parent c9f4a86 commit 61d41d8

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors
66
* Eric Newberry <https://ericnewberry.com>
77
* Junxiao Shi <https://yoursunny.com>
88
* Tianyuan Yu <https://www.tianyuan-yu.com/>
9+
* Alwin Kahlert <https://github.com/akamos>
910

1011
Anonymous Contributors
1112
======================

src/ndn/contrib/cocoapy/runtime.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
__LP64__ = (8*struct.calcsize("P") == 64)
4242
__i386__ = (platform.machine() == 'i386')
43+
__arm64__ = (platform.machine() == 'arm64')
4344

4445
if sizeof(c_void_p) == 4:
4546
c_ptrdiff_t = c_int32
@@ -129,9 +130,11 @@
129130
objc.class_getMethodImplementation.restype = c_void_p
130131
objc.class_getMethodImplementation.argtypes = [c_void_p, c_void_p]
131132

132-
# IMP class_getMethodImplementation_stret(Class cls, SEL name)
133-
objc.class_getMethodImplementation_stret.restype = c_void_p
134-
objc.class_getMethodImplementation_stret.argtypes = [c_void_p, c_void_p]
133+
if not __arm64__:
134+
# marked as OBJC_ARM64_UNAVAILABLE
135+
# IMP class_getMethodImplementation_stret(Class cls, SEL name)
136+
objc.class_getMethodImplementation_stret.restype = c_void_p
137+
objc.class_getMethodImplementation_stret.argtypes = [c_void_p, c_void_p]
135138

136139
# const char * class_getName(Class cls)
137140
objc.class_getName.restype = c_char_p
@@ -278,14 +281,20 @@
278281
# id objc_msgSend(id theReceiver, SEL theSelector, ...)
279282
# id objc_msgSendSuper(struct objc_super *super, SEL op, ...)
280283

281-
# void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...)
282-
objc.objc_msgSendSuper_stret.restype = None
284+
if not __arm64__:
285+
# marked as OBJC_ARM64_UNAVAILABLE
286+
# void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...)
287+
objc.objc_msgSendSuper_stret.restype = None
283288

284-
# double objc_msgSend_fpret(id self, SEL op, ...)
285-
# objc.objc_msgSend_fpret.restype = c_double
289+
if not __arm64__:
290+
# marked as OBJC_ARM64_UNAVAILABLE
291+
# double objc_msgSend_fpret(id self, SEL op, ...)
292+
objc.objc_msgSend_fpret.restype = c_double
286293

287-
# void objc_msgSend_stret(void * stretAddr, id theReceiver, SEL theSelector, ...)
288-
objc.objc_msgSend_stret.restype = None
294+
if not __arm64__:
295+
# marked as OBJC_ARM64_UNAVAILABLE
296+
# void objc_msgSend_stret(void * stretAddr, id theReceiver, SEL theSelector, ...)
297+
objc.objc_msgSend_stret.restype = None
289298

290299
# void objc_registerClassPair(Class cls)
291300
objc.objc_registerClassPair.restype = None

0 commit comments

Comments
 (0)