Index: src/OFStream.m ================================================================== --- src/OFStream.m +++ src/OFStream.m @@ -1805,11 +1805,11 @@ return _blocking; } - (void)setBlocking: (bool)enable { -#if defined(HAVE_FCNTL) +#if defined(HAVE_FCNTL) && !defined(OF_MORPHOS) bool readImplemented = false, writeImplemented = false; @try { int readFlags; Index: src/OFStreamSocket.m ================================================================== --- src/OFStreamSocket.m +++ src/OFStreamSocket.m @@ -122,14 +122,18 @@ #endif return (size_t)bytesWritten; } -#ifdef OF_WINDOWS +#if defined(OF_WINDOWS) || defined(OF_MORPHOS) - (void)setBlocking: (bool)enable { +# ifdef OF_WINDOWS u_long v = enable; +# else + char v = enable; +# endif if (ioctlsocket(_socket, FIONBIO, &v) == SOCKET_ERROR) @throw [OFSetOptionFailedException exceptionWithObject: self errNo: of_socket_errno()]; Index: src/socket_helpers.h ================================================================== --- src/socket_helpers.h +++ src/socket_helpers.h @@ -46,17 +46,19 @@ #ifndef SOCK_CLOEXEC # define SOCK_CLOEXEC 0 #endif -#if !defined(OF_WINDOWS) && !defined(OF_WII) -# define closesocket(sock) close(sock) -#endif - -#ifdef OF_MORPHOS +#if defined(OF_MORPHOS) +# include +# define closesocket(sock) CloseSocket(sock) +# define ioctlsocket(fd, req, arg) IoctlSocket(fd, req, arg) # define hstrerror(err) "unknown (no hstrerror)" +# define SOCKET_ERROR -1 typedef uint32_t in_addr_t; +#elif !defined(OF_WINDOWS) && !defined(OF_WII) +# define closesocket(sock) close(sock) #endif #ifdef OF_MORPHOS_IXEMUL typedef uint32_t in_addr_t; #endif