use autoconf to check for struct timespec

This commit is contained in:
Bradley Bell 2003-04-30 20:05:52 +00:00
parent 75da1d2aff
commit 5e9b4bd159
3 changed files with 13 additions and 7 deletions

View file

@ -2,6 +2,9 @@
2003-04-30 Bradley Bell <btb@icculus.org>
* configure.ac, libmve/mveplay.c: use autoconf to check for struct
timespec
* Makefile.am, NEWS, README, configure.ac: fix linking bug,
increment version number

View file

@ -37,6 +37,7 @@ AC_STDC_HEADERS
AC_PATH_PROGS(NASM, nasm nasmw, no)
AC_C_BIGENDIAN
AC_CHECK_DECLS(nanosleep)
AC_CHECK_TYPES(struct timespec)
case $host_cpu in
sparc)

View file

@ -1,4 +1,4 @@
/* $Id: mveplay.c,v 1.10 2003-04-29 08:05:41 btb Exp $ */
/* $Id: mveplay.c,v 1.11 2003-04-30 20:05:52 btb Exp $ */
#ifdef HAVE_CONFIG_H
#include <conf.h>
#endif
@ -130,6 +130,14 @@ static int micro_frame_delay=0;
static int timer_started=0;
static struct timeval timer_expire = {0, 0};
#if !HAVE_STRUCT_TIMESPEC
struct timespec
{
long int tv_sec; /* Seconds. */
long int tv_nsec; /* Nanoseconds. */
};
#endif
#if defined(HAVE_DECL_NANOSLEEP) && !HAVE_DECL_NANOSLEEP
int nanosleep(struct timespec *ts, void *rem);
#endif
@ -137,12 +145,6 @@ int nanosleep(struct timespec *ts, void *rem);
#ifdef __WIN32
#include <sys/timeb.h>
struct timespec
{
long int tv_sec; /* Seconds. */
long int tv_nsec; /* Nanoseconds. */
};
int gettimeofday(struct timeval *tv, void *tz)
{
static int counter = 0;