Work around a bug in clang 3.1 that declares objc_msgSend_stret as a builtin

with the wrong signature.
main
theraven 13 years ago
parent 197dbaba7c
commit 3fbdbe4d02

@ -37,7 +37,17 @@ id objc_msgSend(id self, SEL _cmd, ...);
#ifdef __cplusplus #ifdef __cplusplus
id objc_msgSend_stret(id self, SEL _cmd, ...); id objc_msgSend_stret(id self, SEL _cmd, ...);
#else #else
// There is a bug in older versions of clang that incorrectly declares the
// signature of this function as a builtin.
# ifdef __clang__
# if (__clang_major__ > 3) || ((__clang_major__ == 3) && __clang_minor__ >= 2)
void objc_msgSend_stret(id self, SEL _cmd, ...); void objc_msgSend_stret(id self, SEL _cmd, ...);
# else
id objc_msgSend_stret(id self, SEL _cmd, ...);
# endif
# else
void objc_msgSend_stret(id self, SEL _cmd, ...);
# endif
#endif #endif
/** /**
* Standard message sending function. This function must be cast to the * Standard message sending function. This function must be cast to the

@ -95,7 +95,7 @@
push %rsi # Save self where it can be modified push %rsi # Save self where it can be modified
mov %rsp, %rdi mov %rsp, %rdi
push %rdx push %rdx
mov %rdx, %rsi # move _cmd to where the callee expects it to be mov %rdx, %rsi # move _cmd to where the callee expects it to be
.endif .endif
.cfi_adjust_cfa_offset 0xD8 .cfi_adjust_cfa_offset 0xD8

Loading…
Cancel
Save