mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
check archiving
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3142 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bf3c3b5ded
commit
683cfb1923
1 changed files with 250 additions and 237 deletions
|
@ -2,6 +2,7 @@
|
|||
#include <Foundation/NSInvocation.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <Foundation/NSArchiver.h>
|
||||
|
||||
typedef struct {
|
||||
char c;
|
||||
|
@ -154,7 +155,19 @@ typedef struct {
|
|||
}
|
||||
- (void) forwardInvocation: (NSInvocation*)inv
|
||||
{
|
||||
[inv invokeWithTarget: obj];
|
||||
NSData *d = [NSArchiver archivedDataWithRootObject: inv];
|
||||
NSInvocation *i = [NSUnarchiver unarchiveObjectWithData: d];
|
||||
unsigned l;
|
||||
void *b;
|
||||
|
||||
[i invokeWithTarget: obj];
|
||||
d = [NSArchiver archivedDataWithRootObject: i];
|
||||
i = [NSUnarchiver unarchiveObjectWithData: d];
|
||||
l = [[i methodSignature] methodReturnLength];
|
||||
b = (void *)objc_malloc(l);
|
||||
[i getReturnValue: b];
|
||||
[inv setReturnValue: b];
|
||||
objc_free(b);
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue