Index: src/OFFile.h ================================================================== --- src/OFFile.h +++ src/OFFile.h @@ -17,11 +17,13 @@ #import "OFSeekableStream.h" OF_ASSUME_NONNULL_BEGIN #if defined(OF_MORPHOS) && !defined(OF_IXEMUL) -typedef long BPTR; +# define BOOL EXEC_BOOL +# include +# undef BOOL #endif /*! * @class OFFile OFFile.h ObjFW/OFFile.h * Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -41,16 +41,10 @@ #ifdef OF_WINDOWS # include #endif -#if defined(OF_MORPHOS) && !defined(OF_IXEMUL) -# define BOOL EXEC_BOOL -# include -# undef BOOL -#endif - #ifdef OF_WII # define BOOL OGC_BOOL # include # undef BOOL #endif Index: src/OFStdIOStream.h ================================================================== --- src/OFStdIOStream.h +++ src/OFStdIOStream.h @@ -17,11 +17,13 @@ #import "OFStream.h" OF_ASSUME_NONNULL_BEGIN #if defined(OF_MORPHOS) && !defined(OF_IXEMUL) -typedef long BPTR; +# define BOOL EXEC_BOOL +# include +# undef BOOL #endif /*! * @class OFStdIOStream OFStdIOStream.h ObjFW/OFStdIOStream.h * Index: src/OFStdIOStream.m ================================================================== --- src/OFStdIOStream.m +++ src/OFStdIOStream.m @@ -40,11 +40,10 @@ #import "OFWriteFailedException.h" #if defined(OF_MORPHOS) && !defined(OF_IXEMUL) # define BOOL EXEC_BOOL # include -# include # undef BOOL #endif /* References for static linking */ #ifdef OF_WINDOWS Index: src/socket.h ================================================================== --- src/socket.h +++ src/socket.h @@ -19,13 +19,21 @@ #ifndef OF_HAVE_SOCKETS # error No sockets available! #endif #include + +#import "platform.h" #ifdef OF_HAVE_SYS_SOCKET_H +# if defined(OF_MORPHOS) && !defined(OF_IXEMUL) +# define BOOL EXEC_BOOL +# endif # include +# if defined(OF_MORPHOS) && !defined(OF_IXEMUL) +# undef BOOL +# endif #endif #ifdef OF_HAVE_NETINET_IN_H # include #endif #ifdef OF_HAVE_NETINET_TCP_H @@ -44,11 +52,15 @@ # include # include #endif #ifdef OF_MORPHOS +# ifndef OF_IXEMUL +typedef long socklen_t; +# else typedef int socklen_t; +#endif struct sockaddr_storage { uint8_t ss_len; uint8_t ss_family; char ss_data[2 + sizeof(struct in_addr) + 8]; Index: src/socket_helpers.h ================================================================== --- src/socket_helpers.h +++ src/socket_helpers.h @@ -59,10 +59,13 @@ #if !defined(OF_WINDOWS) && !defined(OF_WII) # define closesocket(sock) close(sock) #endif #ifdef OF_MORPHOS +# ifndef OF_IXEMUL +# define hstrerror(err) "unknown (no hstrerror)" +# endif typedef uint32_t in_addr_t; #endif #ifdef OF_WII # define accept(sock, addr, addrlen) net_accept(sock, addr, addrlen)