mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix for cygwin
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4330 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9f4fbbee9f
commit
91c136b68c
4 changed files with 17 additions and 9 deletions
|
@ -27,7 +27,7 @@
|
|||
#include <base/preface.h>
|
||||
#include <base/Port.h>
|
||||
#include <base/RunLoop.h>
|
||||
#ifndef __WIN32__
|
||||
#if !defined(__WIN32__) || defined(__CYGWIN__)
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <netdb.h>
|
||||
/* #include <libc.h> */
|
||||
|
||||
#ifdef __WIN32__
|
||||
#if defined(__WIN32__) && !defined(__CYGWIN__)
|
||||
#include <Windows32/Sockets.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#ifndef __WIN32__
|
||||
#if !defined(__WIN32__) || defined(__CYGWIN__)
|
||||
#include <unistd.h> /* for gethostname() */
|
||||
#include <sys/param.h> /* for MAXHOSTNAMELEN */
|
||||
#include <netinet/in.h> /* for inet_ntoa() */
|
||||
|
@ -80,7 +80,7 @@
|
|||
|
||||
#endif /* !__WIN32__ */
|
||||
#include <string.h> /* for memset() and strchr() */
|
||||
#ifndef __WIN32__
|
||||
#if !defined(__WIN32__) || defined(__CYGWIN__)
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include <Foundation/NSHost.h>
|
||||
#include <Foundation/NSByteOrder.h>
|
||||
|
||||
#if defined(__WIN32__)
|
||||
#if defined(__WIN32__) && !defined(__CYGWIN__)
|
||||
#include <Windows32/Sockets.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
|
@ -69,6 +69,14 @@
|
|||
#define NBLK_OPT FNDELAY
|
||||
#endif
|
||||
|
||||
#ifndef O_BINARY
|
||||
#ifdef _O_BINARY
|
||||
#define O_BINARY _O_BINARY
|
||||
#else
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Maximum data in single I/O operation
|
||||
#define NETBUF_SIZE 4096
|
||||
|
||||
|
@ -378,7 +386,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
- (id)initForReadingAtPath: (NSString*)path
|
||||
{
|
||||
int d = open([path fileSystemRepresentation], O_RDONLY);
|
||||
int d = open([path fileSystemRepresentation], O_RDONLY|O_BINARY);
|
||||
|
||||
if (d < 0)
|
||||
{
|
||||
|
@ -396,7 +404,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
- (id)initForWritingAtPath: (NSString*)path
|
||||
{
|
||||
int d = open([path fileSystemRepresentation], O_WRONLY);
|
||||
int d = open([path fileSystemRepresentation], O_WRONLY|O_BINARY);
|
||||
|
||||
if (d < 0)
|
||||
{
|
||||
|
@ -414,7 +422,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
- (id)initForUpdatingAtPath: (NSString*)path
|
||||
{
|
||||
int d = open([path fileSystemRepresentation], O_RDWR);
|
||||
int d = open([path fileSystemRepresentation], O_RDWR|O_BINARY);
|
||||
|
||||
if (d < 0)
|
||||
{
|
||||
|
@ -483,7 +491,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
|
|||
|
||||
- (id)initWithNullDevice
|
||||
{
|
||||
self = [self initWithFileDescriptor: open("/dev/null", O_RDWR)
|
||||
self = [self initWithFileDescriptor: open("/dev/null", O_RDWR|O_BINARY)
|
||||
closeOnDealloc: YES];
|
||||
if (self) {
|
||||
isNullDevice = YES;
|
||||
|
|
Loading…
Reference in a new issue