mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Get test/examples working again
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28361 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
6215b5cae8
commit
870117a261
6 changed files with 231 additions and 12 deletions
|
@ -10,6 +10,8 @@
|
|||
*/
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSConnection.h>
|
||||
#include <Foundation/NSPort.h>
|
||||
#include <Foundation/NSPortNameServer.h>
|
||||
#include <Foundation/NSDistantObject.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSNotification.h>
|
||||
|
@ -475,6 +477,8 @@ int main(int argc, char *argv[], char **env)
|
|||
id l;
|
||||
id o = [[NSObject alloc] init];
|
||||
NSConnection *c;
|
||||
NSPortNameServer *ns;
|
||||
NSPort *port;
|
||||
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||
#ifndef __MINGW32__
|
||||
extern int optind;
|
||||
|
@ -487,7 +491,7 @@ int main(int argc, char *argv[], char **env)
|
|||
[NSProcessInfo initializeWithArguments: argv count: argc environment: env];
|
||||
debug = 0;
|
||||
timeout = 0;
|
||||
while ((i = getopt(argc, argv, "hdt:")) != EOF)
|
||||
while ((i = wgetopt(argc, argv, "hdt:")) != EOF)
|
||||
switch (i)
|
||||
{
|
||||
case 'd':
|
||||
|
@ -518,13 +522,16 @@ int main(int argc, char *argv[], char **env)
|
|||
[NSConnection setDebug: debug];
|
||||
[NSObject enableDoubleReleaseCheck: YES];
|
||||
}
|
||||
c = [NSConnection defaultConnection];
|
||||
ns = [NSSocketPortNameServer sharedInstance];
|
||||
port = [NSSocketPort port];
|
||||
c = [NSConnection connectionWithReceivePort: port sendPort: port];
|
||||
[c setRootObject: l];
|
||||
|
||||
if (optind < argc)
|
||||
[c registerName: [NSString stringWithUTF8String: argv[optind]]];
|
||||
[c registerName: [NSString stringWithUTF8String: argv[optind]]
|
||||
withNameServer: ns];
|
||||
else
|
||||
[c registerName: @"test2server"];
|
||||
[c registerName: @"test2server" withNameServer: ns];
|
||||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue