diff --git a/configure.in b/configure.in index 670820bb6..e065a1836 100644 --- a/configure.in +++ b/configure.in @@ -158,6 +158,8 @@ else AC_C_BIGENDIAN fi +AC_CHECK_FUNCS(usleep) + AC_MSG_CHECKING(for fnmatch) AC_TRY_LINK( [], diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index a9f96e45c..68ddfb088 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1452,8 +1452,10 @@ Host_Frame (float time) // decide the simulation time if ((sleeptime = Host_SimulationTime (time)) != 0) { +#ifdef HAVE_USLEEP if (sleeptime > 0.01) // minimum sleep time usleep((unsigned long)((sleeptime - 0.001) * 1000000)); +#endif return; // framerate is too high }