Browse Source

* configure.ac src/time.c:

+ Look for Sleep in -lkernel32.
  * examples/cacaview.c:
    + Use caca_wait_event() instead of usleep()/caca_get_event().
tags/v0.99.beta14
Sam Hocevar sam 21 years ago
parent
commit
e8e85d268b
3 changed files with 16 additions and 13 deletions
  1. +7
    -1
      configure.ac
  2. +8
    -11
      examples/cacaview.c
  3. +1
    -1
      src/time.c

+ 7
- 1
configure.ac View File

@@ -29,7 +29,13 @@ AC_ARG_ENABLE(x11,
[ --enable-x11 X11 support (autodetected)])

AC_CHECK_HEADERS(inttypes.h endian.h)
AC_CHECK_FUNCS(vsnprintf getenv putenv strcasecmp usleep Sleep gettimeofday)
AC_CHECK_FUNCS(vsnprintf getenv putenv strcasecmp usleep gettimeofday)
case "${target_os}" in
*mingw32*|*cygwin*)
AC_CHECK_LIB(kernel32, Sleep,
[AC_DEFINE(HAVE_KERNEL32_SLEEP, 1, [Define if you have Windows' Sleep])])
;;
esac
AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")

CACA_DRIVERS=""


+ 8
- 11
examples/cacaview.c View File

@@ -114,7 +114,12 @@ int main(int argc, char **argv)

unsigned int event, new_status = 0, new_help = 0;

while((event = caca_get_event(CACA_EVENT_KEY_PRESS)))
if(update)
event = caca_get_event(CACA_EVENT_KEY_PRESS);
else
event = caca_wait_event(CACA_EVENT_KEY_PRESS);

while(event)
{
unsigned int key = event & 0x00ffffff;

@@ -229,6 +234,8 @@ int main(int argc, char **argv)

if(help || new_help)
help = new_help;

event = caca_get_event(CACA_EVENT_KEY_PRESS);
}

if(items && reload)
@@ -258,16 +265,6 @@ int main(int argc, char **argv)
free(buffer);
}

if(!update)
{
#if defined(HAVE_USLEEP)
usleep(10000);
#elif defined(HAVE_SLEEP)
Sleep(10);
#endif
continue;
}

caca_clear();

if(!items)


+ 1
- 1
src/time.c View File

@@ -46,7 +46,7 @@ void _caca_sleep(unsigned int usec)
{
#if defined(HAVE_USLEEP)
usleep(usec);
#elif defined(HAVE_SLEEP)
#elif defined(HAVE_KERNEL32_SLEEP)
Sleep(usec / 1000);
#else
SLEEP


Loading…
Cancel
Save