From ea3257eefc56f348c4ba4792312857fc7c9976ae Mon Sep 17 00:00:00 2001 From: CaS Date: Thu, 18 Apr 2002 06:02:22 +0000 Subject: [PATCH] Fix to include config.h in all cases git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13490 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Testing/nsnotification.m | 40 ++++++++++++++++++++++++++++++++++++++-- Tools/gdomap.c | 13 +++++++------ 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebed72a1b..eacc3d03d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-04-17 Richard Frith-Macdonald + + * Tools/gdomap.c: re-order headers so config.h is used on windoze + 2002-04-16 Richard Frith-Macdonald * config/config.reuseaddr.c: New test for broken SO_REUSEADDR diff --git a/Testing/nsnotification.m b/Testing/nsnotification.m index 503d0697a..3719ad136 100644 --- a/Testing/nsnotification.m +++ b/Testing/nsnotification.m @@ -28,11 +28,17 @@ id foo = @"NotificationTestFoo"; int main () { - id o1 = [NSObject new]; - id observer1 = [Observer new]; + id o1; + id observer1; id arp; arp = [NSAutoreleasePool new]; +NSLog(@"Make string object"); + o1 = [NSString new]; +NSLog(@"Make Observer object"); + observer1 = [Observer new]; + +NSLog(@"Add observer to process centre"); [[NSNotificationCenter defaultCenter] addObserver: observer1 @@ -40,24 +46,54 @@ int main () name: foo object: o1]; +NSLog(@"Add observer to distributed centre"); + [[NSDistributedNotificationCenter defaultCenter] + addObserver: observer1 + selector: @selector(gotNotificationFoo:) + name: foo + object: o1]; + +NSLog(@"Add observer to process centre"); [[NSNotificationCenter defaultCenter] addObserver: observer1 selector: @selector(gotNotificationFooNoObject:) name: foo object: nil]; +NSLog(@"Add observer to distributed centre"); + [[NSDistributedNotificationCenter defaultCenter] + addObserver: observer1 + selector: @selector(gotNotificationFooNoObject:) + name: foo + object: nil]; + +NSLog(@"Post to process centre"); /* This will cause two messages to be printed, one for each request above. */ [[NSNotificationCenter defaultCenter] postNotificationName: foo object: o1]; +NSLog(@"Post to distributed centre"); + /* This will cause two messages to be printed, one for each request above. */ + [[NSDistributedNotificationCenter defaultCenter] + postNotificationName: foo + object: o1]; + +NSLog(@"Post to process centre"); /* This will cause one message to be printed. */ [[NSNotificationCenter defaultCenter] postNotificationName: foo object: nil]; +NSLog(@"Post to distributed centre"); + /* This will cause one message to be printed. */ + [[NSDistributedNotificationCenter defaultCenter] + postNotificationName: foo + object: nil]; + +NSLog(@"Remove observer from process centre"); [[NSNotificationCenter defaultCenter] removeObserver: observer1 name: nil diff --git a/Tools/gdomap.c b/Tools/gdomap.c index defcc5623..1fe8311b5 100644 --- a/Tools/gdomap.c +++ b/Tools/gdomap.c @@ -43,6 +43,7 @@ #include /* for strchr() */ #include /* for strchr() */ #include +#include "config.h" #ifdef __MINGW__ #include #include @@ -56,7 +57,6 @@ #include #include #include -#include "config.h" #ifdef HAVE_TIME_H #include #endif @@ -64,6 +64,9 @@ #include #endif +#if HAVE_GETOPT_H +#include +#endif /* * Stuff for setting the sockets into non-blocking mode. @@ -93,10 +96,6 @@ #include #endif -#if HAVE_GETOPT_H -#include -#endif - #include "gdomap.h" /* * ABOUT THIS PROGRAM @@ -174,8 +173,10 @@ static void queue_probe(struct in_addr* to, struct in_addr *from, int num_extras, struct in_addr* extra, int is_reply); -#if (defined __MINGW__) +#ifdef __MINGW__ + /* A simple implementation of getopt() */ + static int indexof(char c, char *string) {