Copyright © 2006 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
+#ifdef WIN32
+#include <io.h>
+#include <fcntl.h>
+#endif
+
#include "application.h"
#include "event.h"
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