Commit 27d643ed authored by Hanspeter Portner's avatar Hanspeter Portner

Squashed 'osc.lv2/' changes from d99b20c..6885c8f

6885c8f fix last commit for mingw.
4e5a72c prototype pollin.

git-subtree-dir: osc.lv2
git-subtree-split: 6885c8f18597cd4bc2611b17fbf7145c8783c6d4
parent 595762c9
......@@ -34,6 +34,7 @@
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <poll.h>
#include <osc.lv2/osc.h>
......@@ -1372,6 +1373,37 @@ lv2_osc_stream_run(LV2_OSC_Stream *stream)
return ev;
}
static LV2_OSC_Enum
lv2_osc_stream_pollin(LV2_OSC_Stream *stream, int timeout_ms)
{
struct pollfd fds [2] = {
[0] = {
.fd = stream->sock,
.events = POLLIN,
.revents = 0
},
[1] = {
.fd = stream->fd,
.events = POLLIN,
.revents = 0
}
};
const int res = poll(fds, 2, timeout_ms);
if(res < 0)
{
return LV2_OSC_STREAM_ERRNO(LV2_OSC_NONE, errno);
}
#if 0
fprintf(stderr, "++ %i: %i %i %i %i\n", res,
fds[0].fd, (int)fds[0].revents,
fds[1].fd, (int)fds[1].revents);
#endif
return lv2_osc_stream_run(stream);
}
#ifdef __cplusplus
} // extern "C"
#endif
......
......@@ -1119,10 +1119,11 @@ _run_test_hooks()
}
int
main(int argc, char **argv)
main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
{
(void)argc;
(void)argv;
#if !defined(_WIN32)
(void)lv2_osc_stream_pollin; //FIXME
#endif
fprintf(stdout, "running main tests:\n");
assert(_run_tests() == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment