iGet distributed notifications working with NSMessagePort on mingw32

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21987 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-11-11 10:24:28 +00:00
parent 50969bf11d
commit 26f653b0d4
3 changed files with 26 additions and 8 deletions

View file

@ -5,6 +5,8 @@
* Testing/nsconnection_client.m: don't run large structure test on * Testing/nsconnection_client.m: don't run large structure test on
mingw32 at present ... it crashes (something wrong with the invocation mingw32 at present ... it crashes (something wrong with the invocation
stuff for ffcall and some large structures on mingw32) stuff for ffcall and some large structures on mingw32)
* Tools/gdnc.m: Obey GSMailslot default on mingw32.
* Source/NSDistributedNotificationCenter.m: ditto.
2005-11-10 Richard Frith-Macdonald <rfm@gnu.org> 2005-11-10 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -586,9 +586,20 @@ static NSDistributedNotificationCenter *netCenter = nil;
#ifdef __MINGW32__ #ifdef __MINGW32__
if (_type == NSLocalNotificationCenterType) if (_type == NSLocalNotificationCenterType)
{
if ([[NSUserDefaults standardUserDefaults]
boolForKey: @"GSMailslot"] == YES)
{
host = @"";
ns = [NSMessagePortNameServer sharedInstance];
service = GDNC_SERVICE;
description = @"local host";
}
else
{ {
ASSIGN(_type, GSPublicNotificationCenterType); ASSIGN(_type, GSPublicNotificationCenterType);
} }
}
#else #else
if (_type == NSLocalNotificationCenterType) if (_type == NSLocalNotificationCenterType)
{ {
@ -597,9 +608,8 @@ static NSDistributedNotificationCenter *netCenter = nil;
service = GDNC_SERVICE; service = GDNC_SERVICE;
description = @"local host"; description = @"local host";
} }
else
#endif #endif
if (_type == GSPublicNotificationCenterType) else if (_type == GSPublicNotificationCenterType)
{ {
/* /*
* Connect to the NSDistributedNotificationCenter for this host. * Connect to the NSDistributedNotificationCenter for this host.

View file

@ -24,7 +24,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#ifdef __MINGW32__ #if defined(__MINGW32__)
#include "process.h" #include "process.h"
#endif #endif
@ -395,8 +395,16 @@ ihandler(int sig)
} }
else else
{ {
#ifdef __MINGW32__ #if defined(__MINGW32__)
if ([[NSUserDefaults standardUserDefaults]
boolForKey: @"GSMailslot"] == YES)
{
isLocal = YES;
}
else
{
isPublic = YES; isPublic = YES;
}
#else #else
isLocal = YES; isLocal = YES;
#endif #endif
@ -425,7 +433,6 @@ ihandler(int sig)
port = (NSPort*)[NSSocketPort port]; port = (NSPort*)[NSSocketPort port];
} }
} }
#ifndef __MINGW32__
else else
{ {
hostname = @""; hostname = @"";
@ -433,7 +440,6 @@ ihandler(int sig)
ns = [NSMessagePortNameServer sharedInstance]; ns = [NSMessagePortNameServer sharedInstance];
port = (NSPort*)[NSMessagePort port]; port = (NSPort*)[NSMessagePort port];
} }
#endif
conn = [[NSConnection alloc] initWithReceivePort: port sendPort: nil]; conn = [[NSConnection alloc] initWithReceivePort: port sendPort: nil];
[conn setRootObject: self]; [conn setRootObject: self];