Fixed detection of nanosleep.

This commit is contained in:
Michael Jumper 2011-02-11 00:21:54 -08:00
parent 6355be0f36
commit d9682409f7
2 changed files with 5 additions and 4 deletions

View File

@ -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])

View File

@ -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
}