Index: src/OFStdIOStream.m ================================================================== --- src/OFStdIOStream.m +++ src/OFStdIOStream.m @@ -39,15 +39,13 @@ #import "OFReadFailedException.h" #import "OFWriteFailedException.h" #if defined(OF_MORPHOS) && !defined(OF_IXEMUL) # define BOOL EXEC_BOOL -# include +# include # include # undef BOOL -# define getpid() ((int)SysBase->ThisTask) -extern struct ExecBase *SysBase; #endif /* References for static linking */ #ifdef OF_WINDOWS void @@ -101,11 +99,11 @@ of_stdin = [[OFStdIOStream alloc] of_initWithFileDescriptor: 0]; of_stdout = [[OFStdIOStream alloc] of_initWithFileDescriptor: 1]; of_stderr = [[OFStdIOStream alloc] of_initWithFileDescriptor: 2]; # else BPTR input = Input(), output = Output(); - BPTR error = ((struct Process *)SysBase->ThisTask)->pr_CES; + BPTR error = ((struct Process *)FindTask(NULL))->pr_CES; bool inputClosable = false, outputClosable = false, errorClosable = false; if (input == 0) { input = Open("*", MODE_OLDFILE); Index: src/unistd_wrapper.h ================================================================== --- src/unistd_wrapper.h +++ src/unistd_wrapper.h @@ -17,14 +17,20 @@ #include /* Make sure we have any libc include */ #import "platform.h" -#if defined(HAVE_UNISTD_H) && (!defined(OF_MORPHOS) || defined(OF_IXEMUL)) +#if defined(OF_MORPHOS) && !defined(OF_IXEMUL) +# define BOOL EXEC_BOOL +# include +# undef BOOL +#endif + +#if defined(HAVE_UNISTD_H) # ifdef __GLIBC__ # undef __USE_XOPEN /* Needed to avoid old glibc using __block */ # endif # include # ifdef __GLIBC__ # define __USE_XOPEN 1 # endif #endif