bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #36706] performSelector: not working with message fowarding


From: Richard Frith-Macdonald
Subject: [bug #36706] performSelector: not working with message fowarding
Date: Mon, 09 Jul 2012 16:56:16 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2

Update of bug #36706 (project gnustep):

                  Status:                    None => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #10:

I applied Niels' fix along with a few other alterations (one in the FFI code
to allow default forwwarding in some cases for instance).

I think if we were to stick to the Apple runtime API (and maybe we should),
we'd have to do it differently.

If you call class_getMethodImplementation() and the class does not respond to
the selector directly, it will return a forwarding function suitable for
returing a scalar type.

The Apple API also has class_getMethodImplementation_stret() (and perhaps
class_getMethodImplementation_fpret()) to return functions handling different
return values, but I guess you need to know in advance if you need to call
these to get forwarding functions for returning structures and floating
points.

So,  I guess you could cache the address of the standard forwarding function,
and always call class_getMethodImplementation(), but perform extra work if it
returns the address of the standard forwarding function.
In this case, you would then call -methodSignatureForSelector: and examine the
return tye for the method ... if it's a structure, or a floating point value,
yu would call the appropriate runtime method to get the correct forwarding
function, but if it's not then you know the function you already have is the
correct one.

Maybe we should do things the apple way?



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36706>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]