mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +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/NSInvocation.h>
|
||||||
#include <Foundation/NSString.h>
|
#include <Foundation/NSString.h>
|
||||||
#include <Foundation/NSAutoreleasePool.h>
|
#include <Foundation/NSAutoreleasePool.h>
|
||||||
|
#include <Foundation/NSArchiver.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char c;
|
char c;
|
||||||
|
@ -154,7 +155,19 @@ typedef struct {
|
||||||
}
|
}
|
||||||
- (void) forwardInvocation: (NSInvocation*)inv
|
- (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
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue