X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fevent.cpp;fp=source%2Fevent.cpp;h=01b8542a6225c2d0fb7cd703e4bb32d93283ce32;hp=b314fca1730543c0697bfd4abd6f11e8572e1a10;hb=a883560b42163f5ed0c83204469d17dd4f0134b6;hpb=baf2ee40d68be74e6848a5f282ed369d5a616007 diff --git a/source/event.cpp b/source/event.cpp index b314fca..01b8542 100644 --- a/source/event.cpp +++ b/source/event.cpp @@ -3,6 +3,11 @@ This file is part of libmspframework Copyright © 2006 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ +#ifdef WIN32 +#include +#include +#endif + #include "application.h" #include "event.h" @@ -42,17 +47,29 @@ void EventManager::Event::trigger() EventManager::Pipe::Pipe() { +#ifdef WIN32 + _pipe(fd, 1024, _O_BINARY); +#else ::pipe(fd); +#endif } int EventManager::Pipe::write(char *buf, unsigned len) { +#ifdef WIN32 + return _write(fd[1], buf, len); +#else return ::write(fd[1], buf, len); +#endif } int EventManager::Pipe::read(char *buf, unsigned len) { +#ifdef WIN32 + return _read(fd[0], buf, len); +#else return ::read(fd[0], buf, len); +#endif } } // namespace Msp