dnl Check for usual libc functions
AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
-AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r gettimeofday if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp uselocale])
+AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r if_nameindex if_nametoindex isatty lstat memalign mmap openat pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp uselocale])
AC_REPLACE_FUNCS([asprintf atof atoll dirfd flockfile fsync getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind setenv strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdestroy vasprintf])
AC_CHECK_FUNCS(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
return p_date->date;
}
-#ifndef HAVE_GETTIMEOFDAY
-
-#ifdef WIN32
-
-/*
- * Number of micro-seconds between the beginning of the Windows epoch
- * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970).
- *
- * This assumes all Win32 compilers have 64-bit support.
- */
-#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) || defined(__WATCOMC__)
-# define DELTA_EPOCH_IN_USEC 11644473600000000Ui64
-#else
-# define DELTA_EPOCH_IN_USEC 11644473600000000ULL
-#endif
-
-static uint64_t filetime_to_unix_epoch (const FILETIME *ft)
-{
- uint64_t res = (uint64_t) ft->dwHighDateTime << 32;
-
- res |= ft->dwLowDateTime;
- res /= 10; /* from 100 nano-sec periods to usec */
- res -= DELTA_EPOCH_IN_USEC; /* from Win epoch to Unix epoch */
- return (res);
-}
-
-static int gettimeofday (struct timeval *tv, void *tz )
-{
- FILETIME ft;
- uint64_t tim;
-
- if (!tv) {
- return VLC_EGENERIC;
- }
- GetSystemTimeAsFileTime (&ft);
- tim = filetime_to_unix_epoch (&ft);
- tv->tv_sec = (long) (tim / 1000000L);
- tv->tv_usec = (long) (tim % 1000000L);
- return (0);
-}
-
-#endif
-
-#endif
-
/**
* @return NTP 64-bits timestamp in host byte order.
*/