diff --git a/protocols/vnc/configure.in b/protocols/vnc/configure.in index 35d8c3fa..2080594c 100644 --- a/protocols/vnc/configure.in +++ b/protocols/vnc/configure.in @@ -18,6 +18,7 @@ AC_CHECK_LIB([vncclient], [rfbInitClient],, AC_MSG_ERROR("libvncclient is requir AC_CHECK_HEADERS([stdlib.h string.h syslog.h guacamole/client.h guacamole/guacio.h guacamole/protocol.h]) # Checks for library functions. +AC_CHECK_FUNCS([nanosleep]) AC_FUNC_MALLOC AC_CONFIG_FILES([Makefile]) diff --git a/protocols/vnc/src/vnc_client.c b/protocols/vnc/src/vnc_client.c index 6c374433..f66997cd 100644 --- a/protocols/vnc/src/vnc_client.c +++ b/protocols/vnc/src/vnc_client.c @@ -199,17 +199,17 @@ void guac_vnc_cut_text(rfbClient* client, const char* text, int textlen) { void vnc_guac_client_sleep(int millis) { -#ifdef nanosleep +#ifdef HAVE_NANOSLEEP struct timespec sleep_period; sleep_period.tv_sec = 0; sleep_period.tv_nsec = millis * 1000000L; nanosleep(&sleep_period, NULL); -#else -#ifdef Sleep +#elif defined(__MINGW32__) Sleep(millis) -#endif +#else +#warning No sleep/nanosleep function available. VNC client may not perform as expected. Consider editing the vnc_client.c to add support for your platform. #endif }