mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
reinstate deleted code (bug #42405)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37904 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2a7fa54019
commit
43f07926da
5 changed files with 122 additions and 12 deletions
|
@ -39,10 +39,6 @@ typedef struct {
|
|||
BOOL isReg;
|
||||
} NSArgumentInfo;
|
||||
|
||||
@interface NSInvocation (MacroSetup)
|
||||
- (id) initWithMethodSignature: (NSMethodSignature*)aSignature;
|
||||
@end
|
||||
|
||||
|
||||
@interface GSFFIInvocation : NSInvocation
|
||||
{
|
||||
|
@ -77,13 +73,15 @@ GSFFCallInvokeWithTargetAndImp(NSInvocation *inv, id anObject, IMP imp);
|
|||
extern void
|
||||
GSFFIInvokeWithTargetAndImp(NSInvocation *inv, id anObject, IMP imp);
|
||||
|
||||
#define CLEAR_RETURN_VALUE_IF_OBJECT do { if (_validReturn && *_inf[0].type == _C_ID) \
|
||||
{ \
|
||||
RELEASE (*(id*) _retval); \
|
||||
*(id*) _retval = nil; \
|
||||
_validReturn = NO; \
|
||||
}\
|
||||
} while (0)
|
||||
#define CLEAR_RETURN_VALUE_IF_OBJECT \
|
||||
do {\
|
||||
if (_validReturn && *_inf[0].type == _C_ID) \
|
||||
{ \
|
||||
RELEASE (*(id*) _retval); \
|
||||
*(id*) _retval = nil; \
|
||||
_validReturn = NO; \
|
||||
}\
|
||||
} while (0)
|
||||
|
||||
#define RETAIN_RETURN_VALUE IF_NO_GC(do { if (*_inf[0].type == _C_ID) RETAIN (*(id*) _retval);} while (0))
|
||||
|
||||
|
|
|
@ -186,6 +186,22 @@ static Class NSInvocation_concrete_class;
|
|||
|
||||
|
||||
|
||||
GS_ROOT_CLASS
|
||||
@interface GSInvocationProxy
|
||||
{
|
||||
@public
|
||||
Class isa;
|
||||
id target;
|
||||
NSInvocation *invocation;
|
||||
}
|
||||
+ (id) _newWithTarget: (id)t;
|
||||
- (NSInvocation*) _invocation;
|
||||
- (void) forwardInvocation: (NSInvocation*)anInvocation;
|
||||
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector;
|
||||
@end
|
||||
@interface GSMessageProxy : GSInvocationProxy
|
||||
@end
|
||||
|
||||
#define _inf ((NSArgumentInfo*)_info)
|
||||
|
||||
/**
|
||||
|
@ -804,6 +820,23 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal use.
|
||||
*/
|
||||
+ (id) _newProxyForInvocation: (id)target
|
||||
{
|
||||
return (id)[GSInvocationProxy _newWithTarget: target];
|
||||
}
|
||||
+ (id) _newProxyForMessage: (id)target
|
||||
{
|
||||
return (id)[GSMessageProxy _newWithTarget: target];
|
||||
}
|
||||
+ (NSInvocation*) _returnInvocationAndDestroyProxy: (id)proxy
|
||||
{
|
||||
NSInvocation *inv = [proxy _invocation];
|
||||
NSDeallocateObject(proxy);
|
||||
return inv;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation NSInvocation (BackwardCompatibility)
|
||||
|
@ -819,7 +852,6 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
#warning Using dummy NSInvocation implementation. It is strongly recommended that you use libffi.
|
||||
@implementation GSDummyInvocation
|
||||
|
||||
|
||||
/*
|
||||
* This is the de_signated initialiser.
|
||||
*/
|
||||
|
@ -845,3 +877,33 @@ _arg_addr(NSInvocation *inv, int index)
|
|||
@end
|
||||
#endif
|
||||
|
||||
@implementation GSInvocationProxy
|
||||
+ (id) _newWithTarget: (id)t
|
||||
{
|
||||
GSInvocationProxy *o;
|
||||
o = (GSInvocationProxy*) NSAllocateObject(self, 0, NSDefaultMallocZone());
|
||||
o->target = RETAIN(t);
|
||||
return o;
|
||||
}
|
||||
- (NSInvocation*) _invocation
|
||||
{
|
||||
return invocation;
|
||||
}
|
||||
- (void) forwardInvocation: (NSInvocation*)anInvocation
|
||||
{
|
||||
invocation = anInvocation;
|
||||
}
|
||||
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
|
||||
{
|
||||
return [target methodSignatureForSelector: aSelector];
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation GSMessageProxy
|
||||
- (NSInvocation*) _invocation
|
||||
{
|
||||
[invocation setTarget: target];
|
||||
return invocation;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue