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
mingw32 at present ... it crashes (something wrong with the invocation
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>

View file

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

View file

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