diff --git a/ChangeLog b/ChangeLog index 3047df31b..662307033 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-11-22 Richard Frith-Macdonald + + * Source/NSPort.m: + * Source/NSMessagePort.m: + * Source/NSDistributedNotificationCenter.m: + * Tools/gdnc.m: + Use the NSPortIsMessagePort user default consistently to control + whether socket or message ports are used by default. Remove mingw32 + sp[ecific GSMailslot user default. + 2005-11-20 Richard Frith-Macdonald * configure.ac: Add flags to allow detection of headers/libraries diff --git a/Source/NSDistributedNotificationCenter.m b/Source/NSDistributedNotificationCenter.m index 6f84e4540..69ada77fa 100644 --- a/Source/NSDistributedNotificationCenter.m +++ b/Source/NSDistributedNotificationCenter.m @@ -588,18 +588,19 @@ static NSDistributedNotificationCenter *netCenter = nil; Protocol *p = @protocol(GDNCProtocol); NSConnection *c; -#ifdef __MINGW32__ - if (_type == NSLocalNotificationCenterType - && [[NSUserDefaults standardUserDefaults] - boolForKey: @"GSMailslot"] == NO) - { - ASSIGN(_type, GSPublicNotificationCenterType); - } -#endif - if (_type == NSLocalNotificationCenterType) { - ns = [NSMessagePortNameServer sharedInstance]; + NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; + + if ([defs objectForKey: @"NSPortIsMessagePort"] != nil + && [defs boolForKey: @"NSPortIsMessagePort"] == NO) + { + ns = [NSSocketPortNameServer sharedInstance]; + } + else + { + ns = [NSMessagePortNameServer sharedInstance]; + } host = @""; service = GDNC_SERVICE; description = @"local host"; diff --git a/Source/NSPort.m b/Source/NSPort.m index aff963bef..eea40bef1 100644 --- a/Source/NSPort.m +++ b/Source/NSPort.m @@ -83,12 +83,6 @@ Class NSPort_concrete_class; { NSPort_concrete_class = [NSSocketPort class]; } -#if defined(__MINGW32__) - if ([defs boolForKey: @"GSMailslot"] == NO) - { - NSPort_concrete_class = [NSSocketPort class]; - } -#endif } } diff --git a/Source/NSPortNameServer.m b/Source/NSPortNameServer.m index bd8e55e2a..f3122f9a8 100644 --- a/Source/NSPortNameServer.m +++ b/Source/NSPortNameServer.m @@ -88,16 +88,6 @@ { o = [NSMessagePortNameServer sharedInstance]; } -#if defined(__MINGW__) - if ([defs boolForKey: @"GSMailslot"] == YES) - { - o = [NSMessagePortNameServer sharedInstance]; - } - else - { - o = [NSSocketPortNameServer sharedInstance]; - } -#endif nameServer = RETAIN(o); } [gnustep_global_lock unlock]; diff --git a/Tools/gdnc.m b/Tools/gdnc.m index cf7e989a6..e74b198f4 100644 --- a/Tools/gdnc.m +++ b/Tools/gdnc.m @@ -389,19 +389,7 @@ ihandler(int sig) } else { -#if defined(__MINGW32__) - if ([[NSUserDefaults standardUserDefaults] - boolForKey: @"GSMailslot"] == YES) - { - isLocal = YES; - } - else - { - isPublic = YES; - } -#else isLocal = YES; -#endif } @@ -429,10 +417,21 @@ ihandler(int sig) } else { + NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; + + if ([defs objectForKey: @"NSPortIsMessagePort"] != nil + && [defs boolForKey: @"NSPortIsMessagePort"] == NO) + { + ns = [NSSocketPortNameServer sharedInstance]; + port = (NSPort*)[NSSocketPort port]; + } + else + { + ns = [NSMessagePortNameServer sharedInstance]; + port = (NSPort*)[NSMessagePort port]; + } hostname = @""; service = GDNC_SERVICE; - ns = [NSMessagePortNameServer sharedInstance]; - port = (NSPort*)[NSMessagePort port]; } conn = [[NSConnection alloc] initWithReceivePort: port sendPort: nil];