Commit e95d9ed1 authored by sof's avatar sof
Browse files

[project @ 1999-07-03 18:45:04 by sof]

Don't compile in WinSock support under cygwin
parent dd951f2c
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
* $Id: closeFile.c,v 1.4 1999/05/05 10:33:14 sof Exp $
* $Id: closeFile.c,v 1.5 1999/07/03 18:45:04 sof Exp $
*
* hClose Runtime Support
*/
......@@ -9,7 +9,11 @@
#include "Rts.h"
#include "stgio.h"
#ifdef HAVE_WINSOCK_H
#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
#define USE_WINSOCK
#endif
#ifdef USE_WINSOCK
#include <winsock.h>
#endif
......@@ -70,7 +74,7 @@ StgInt flush_buf;
/* Regardless of success or otherwise, the fd field gets smashed. */
while ( (rc =
(
#ifdef HAVE_WINSOCK_H
#ifdef USE_WINSOCK
fo->flags & FILEOBJ_WINSOCK ?
closesocket(fo->fd) :
close(fo->fd))) != 0 ) {
......
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
* $Id: fileObject.c,v 1.3 1999/05/05 10:33:14 sof Exp $
* $Id: fileObject.c,v 1.4 1999/07/03 18:45:04 sof Exp $
*
* hPutStr Runtime Support
*/
......@@ -12,7 +12,11 @@
#include <stdio.h>
#ifdef HAVE_WINSOCK_H
#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
#define USE_WINSOCK
#endif
#ifdef USE_WINSOCK
#include <winsock.h>
#endif
......@@ -181,7 +185,7 @@ IOFileObject* fo;
if ((count =
(
#ifdef HAVE_WINSOCK_H
#ifdef USE_WINSOCK
fo->flags & FILEOBJ_WINSOCK ?
recv(fo->fd, p, len, 0) :
read(fo->fd, p, len))) <= 0 ) {
......
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
* $Id: filePutc.c,v 1.5 1999/05/05 10:33:15 sof Exp $
* $Id: filePutc.c,v 1.6 1999/07/03 18:45:04 sof Exp $
*
* hPutChar Runtime Support
*/
......@@ -10,7 +10,11 @@
#include "stgio.h"
#include "error.h"
#ifdef HAVE_WINSOCK_H
#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
#define USE_WINSOCK
#endif
#ifdef USE_WINSOCK
#include <winsock.h>
#endif
......@@ -79,7 +83,7 @@ StgChar c;
/* Unbuffered, write the character directly. */
while ((rc = (
#ifdef HAVE_WINSOCK_H
#ifdef USE_WINSOCK
fo->flags & FILEOBJ_WINSOCK ?
send(fo->fd, &c, 1, 0) :
write(fo->fd, &c, 1))) == 0 && errno == EINTR) ;
......
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
* $Id: freeFile.c,v 1.4 1999/05/05 10:33:15 sof Exp $
* $Id: freeFile.c,v 1.5 1999/07/03 18:45:04 sof Exp $
*
* Giving up files
*/
......@@ -10,7 +10,11 @@
#include "stgio.h"
#include "fileObject.h"
#ifdef HAVE_WINSOCK_H
#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
#define USE_WINSOCK
#endif
#ifdef USE_WINSOCK
#include <winsock.h>
#endif
......@@ -68,10 +72,10 @@ StgForeignPtr ptr;
flushFile(ptr);
}
#ifdef USE_WINSOCK
if ( fo->flags & FILEOBJ_WINSOCK )
/* Sigh - the cleanup call at the end will do this for us */
return;
#ifdef HAVE_WINSOCK_H
rc = ( fo->flags & FILEOBJ_WINSOCK ? closesocket(fo->fd) : close(fo->fd) );
#else
rc = close(fo->fd);
......
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
* $Id: readFile.c,v 1.5 1999/07/01 13:12:09 simonmar Exp $
* $Id: readFile.c,v 1.6 1999/07/03 18:45:04 sof Exp $
*
* hGetContents Runtime Support
*/
......@@ -9,7 +9,11 @@
#include "Rts.h"
#include "stgio.h"
#ifdef HAVE_WINSOCK_H
#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
#define USE_WINSOCK
#endif
#ifdef USE_WINSOCK
#include <winsock.h>
#endif
......@@ -78,7 +82,7 @@ StgForeignPtr ptr;
while ((count =
(
#ifdef HAVE_WINSOCK_H
#ifdef USE_WINSOCK
fo->flags & FILEOBJ_WINSOCK ?
recv(fd, fo->buf, fo->bufSize, 0) :
read(fd, fo->buf, fo->bufSize))) <= 0 ) {
......@@ -171,7 +175,7 @@ StgInt len;
while ((count =
(
#ifdef HAVE_WINSOCK_H
#ifdef USE_WINSOCK
fo->flags & FILEOBJ_WINSOCK ?
recv(fd, p, len, 0) :
read(fd, p, len))) <= 0 ) {
......@@ -318,7 +322,7 @@ StgForeignPtr ptr;
while ( (count =
(
#ifdef HAVE_WINSOCK_H
#ifdef USE_WINSOCK
fo->flags & FILEOBJ_WINSOCK ?
recv(fo->fd, &c, 1, 0) :
read(fo->fd, &c, 1))) <= 0 ) {
......
/*
* (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
*
* $Id: writeFile.c,v 1.4 1999/05/05 10:33:17 sof Exp $
* $Id: writeFile.c,v 1.5 1999/07/03 18:45:04 sof Exp $
*
* hPutStr Runtime Support
*/
......@@ -9,7 +9,11 @@
#include "Rts.h"
#include "stgio.h"
#ifdef HAVE_WINSOCK_H
#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
#define USE_WINSOCK
#endif
#ifdef USE_WINSOCK
#include <winsock.h>
#endif
......@@ -54,7 +58,7 @@ StgInt bytes;
while ((count =
(
#ifdef HAVE_WINSOCK_H
#ifdef USE_WINSOCK
fo->flags & FILEOBJ_WINSOCK ?
send(fo->fd, fo->buf, bytes, 0) :
write(fo->fd, fo->buf, bytes))) < bytes) {
......@@ -123,7 +127,7 @@ StgInt len;
/* Disallow short writes */
while ((count =
(
#ifdef HAVE_WINSOCK_H
#ifdef USE_WINSOCK
fo->flags & FILEOBJ_WINSOCK ?
send(fo->fd, (char*)buf, (int)len, 0) :
write(fo->fd, (char*)buf, (int)len))) < len ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment