Patch by Tom Koelman

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14985 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-11-13 15:12:39 +00:00
parent 127209ff2d
commit b67bd9b8f4
3 changed files with 37 additions and 7 deletions

View file

@ -1,3 +1,9 @@
2002-11-15 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSThread.m: Port pipe to mingw.
* Tools/gdomap.c: Fix for modern mingw interface lookup.
Patch by Tom Koelman
2002-11-12 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSUserDefaults.m: Try again ... get

View file

@ -641,23 +641,47 @@ static NSDate *theFuture;
+ (void) initialize
{
int fd[2];
NSRunLoop *loop = GSRunLoopForThread(defaultThread);
NSArray *m = commonModes();
unsigned count = [m count];
unsigned i;
BOOL pipeOK = NO;
theFuture = RETAIN([NSDate distantFuture]);
pipe(fd);
#ifndef __MINGW__
{
int fd[2];
if (pipe(fd) == 0)
{
inputFd = fd[0];
outputFd = fd[1];
pipeOK = YES;
}
}
#else
{
HANDLE readh, writeh;
if (CreatePipe(&readh, &writeh, NULL, 0) != 0)
{
inputFd = _open_osfhandle((int)readh, 0);
outputFd = _open_osfhandle((int)writeh, 0);
pipeOK = YES;
}
}
#endif
if (pipeOK == NO)
{
[NSException raise: NSInternalInconsistencyException
format: @"Failed to create pipe to handle perform in main thread"];
}
subthreadsLock = [[NSLock alloc] init];
perfArray = [[NSMutableArray alloc] initWithCapacity: 10];
inputFd = fd[0];
outputFd = fd[1];
for (i = 0; i < count; i++ )
{
[loop addEvent: (void*)inputFd

View file

@ -1106,7 +1106,7 @@ init_iface()
u_long nFlags = InterfaceList[i].iiFlags;
if ((nFlags & IFF_UP)
&& (InterfaceList[i].iiAddress.sa_family == AF_INET))
&& (InterfaceList[i].iiAddress.Address.sa_family == AF_INET))
{
countActive++;
}
@ -1129,7 +1129,7 @@ init_iface()
u_long nFlags = InterfaceList[i].iiFlags;
if ((nFlags & IFF_UP)
&& (InterfaceList[i].iiAddress.sa_family == AF_INET))
&& (InterfaceList[i].iiAddress.Address.sa_family == AF_INET))
{
int broadcast = 0;
int pointopoint = 0;