From 1f29dc180b5a86ddf2115f97ad410e0e9b1beb4b Mon Sep 17 00:00:00 2001 From: David Date: Thu, 4 Feb 2010 21:37:00 +0000 Subject: david - Made a build-M3 file for building to windows (mingw). This one actually builds *.cpp, yay!... Although i took out Process, Plugger, and Regex... to be re-added later... also had to stubify a few more functions when compiling on WIN32. --- src/fifo.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/fifo.cpp') diff --git a/src/fifo.cpp b/src/fifo.cpp index 1bbab37..eaf1705 100644 --- a/src/fifo.cpp +++ b/src/fifo.cpp @@ -12,6 +12,8 @@ #include #include +#include "win32_compatibility.h" + namespace Bu { subExceptionDef( FifoException ) } Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) : @@ -19,6 +21,7 @@ Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) : iIn( -1 ), iOut( -1 ) { +#ifndef WIN32 if( iFlags&Create ) { if( mkfifo( sName.getStr(), mAcc ) ) @@ -40,6 +43,9 @@ Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) : O_WRONLY ); } +#else + #warning Bu::Fifo::Fifo IS A STUB for WIN32!!!! +#endif } Bu::Fifo::~Fifo() @@ -126,15 +132,23 @@ bool Bu::Fifo::isSeekable() bool Bu::Fifo::isBlocking() { +#ifndef WIN32 return ((fcntl( iIn, F_GETFL, 0 )&O_NONBLOCK) == O_NONBLOCK); +#else + #warning Bu::Fifo::isBlocking IS A STUB for WIN32!!!! +#endif } void Bu::Fifo::setBlocking( bool bBlocking ) { +#ifndef WIN32 if( bBlocking ) fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )&(~O_NONBLOCK) ); else fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )|O_NONBLOCK ); +#else + #warning Bu::Fifo::setBlocking IS A STUB for WIN32!!!! +#endif } void Bu::Fifo::flush() -- cgit v1.2.3