]> git.tdb.fi Git - libs/core.git/blobdiff - source/pollable.cpp
Win32 tweaks
[libs/core.git] / source / pollable.cpp
index 805521d7e2383a77025547707c510a3278a81844..4b0cb1c7bb3804e3aeef109a27405ae0ceac57c8 100644 (file)
@@ -3,18 +3,28 @@ This file is part of libmspframework
 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
+#ifdef WIN32
+#include <winsock2.h>
+#include "win32poll.h"
+#else
 #include <poll.h>
+#endif
 #include "pollable.h"
 
 namespace Msp {
 
 short Pollable::poll(short events, int timeout)
 {
+#ifdef WIN32
+       return 0;
+#else
        pollfd pfd={get_fd(), events, 0};
+       int result=select(&pfd, 1, timeout);
        int result=::poll(&pfd, 1, timeout);
        if(result<=0)
                return result;
        return pfd.revents;
+#endif
 }
 
 }