X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fevent.cpp;h=01b8542a6225c2d0fb7cd703e4bb32d93283ce32;hb=53098601859a2ec9d70870735a805a1dcde17490;hp=b314fca1730543c0697bfd4abd6f11e8572e1a10;hpb=1013e3c216cdf8e0ecc0f3b1e8314989b5333818;p=libs%2Fcore.git 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