diff --git a/src/dyad.c b/src/dyad.c index deb9972..8d8299b 100644 --- a/src/dyad.c +++ b/src/dyad.c @@ -7,7 +7,9 @@ #ifdef _WIN32 #define _WIN32_WINNT 0x501 - #define _CRT_SECURE_NO_WARNINGS + #ifndef _CRT_SECURE_NO_WARNINGS + #define _CRT_SECURE_NO_WARNINGS + #endif #include #include #include @@ -700,8 +702,17 @@ void dyad_update(void) { } /* Init timeout value and do select */ + #ifdef _WIN32 + #pragma warning(push) + /* Disable double to long implicit conversion warning, + * because the type of timeval's fields don't agree across platforms */ + #pragma warning(disable: 4244) + #endif tv.tv_sec = dyad_updateTimeout; tv.tv_usec = (dyad_updateTimeout - tv.tv_sec) * 1e6; + #ifdef _WIN32 + #pragma warning(pop) + #endif select(dyad_selectSet.maxfd + 1, dyad_selectSet.fds[SELECT_READ],