August 14, 2015
On Friday, 14 August 2015 at 12:31:15 UTC, Jacob Carlborg wrote:
> On 2015-08-14 13:19, ponce wrote:
>> How best
>> to contact you?
>
> I guess it depends on the time zones, I'm living in UTC+2.

I'm in the UTC+1 zone.

> Yeah, here comes the tricky part. All methods returning a struct must use the objc_msgSend_stret, EXCEPT if the struct is so small it will fit in registers, then it must use the regular objc_msgSend function.
>
> Also, you always need to cast the objc_msgSend_* function to the correct signature, the signature of the target method.

I see. I've indeed started to cast but only to get the right return type, and left the vararg list. That may be the problem.


August 14, 2015
On 2015-08-14 14:39, ponce wrote:

> I see. I've indeed started to cast but only to get the right return
> type, and left the vararg list. That may be the problem.

The signature of the objc_msgSend function is mostly irrelevant. The function needs to be casted because it will jump to the implementation of the method so the arguments to the objc_msgSend call needs to be setup as the implementation of the method expects.

-- 
/Jacob Carlborg
August 14, 2015
On Friday, 14 August 2015 at 14:44:13 UTC, Jacob Carlborg wrote:
> On 2015-08-14 14:39, ponce wrote:
>
>> I see. I've indeed started to cast but only to get the right return
>> type, and left the vararg list. That may be the problem.
>
> The signature of the objc_msgSend function is mostly irrelevant. The function needs to be casted because it will jump to the implementation of the method so the arguments to the objc_msgSend call needs to be setup as the implementation of the method expects.

Thanks. I've solved my problem which was about D callbacks signatures instead of objc_msgSend trampolines. Oddly enough, variadic calls seem to work for now.
August 15, 2015
On 2015-08-14 22:38, ponce wrote:

> Thanks. I've solved my problem which was about D callbacks signatures
> instead of objc_msgSend trampolines. Oddly enough, variadic calls seem
> to work for now.

I guess that depends on the ABI. I know I had some problems with floating point numbers because I made some mistake, but perhaps that was for method returning a floating point number.

-- 
/Jacob Carlborg
1 2
Next ›   Last »