]> git.sesse.net Git - vlc/commitdiff
Remove unused gettimeofday() Win32 replacement
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 14 Jul 2011 17:46:51 +0000 (20:46 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 14 Jul 2011 17:55:18 +0000 (20:55 +0300)
configure.ac
src/misc/mtime.c

index c5bf290deff4129757be334f5096050fdf7e0a6d..24a18ed5fa4cb98eb69d93a42854dfc9c9596b9b 100644 (file)
@@ -567,7 +567,7 @@ need_libc=false
 
 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.])
index d3d20e83537d2795869f406b632af0b79a1c2409..da0d8bfc374f0f4f5fe17760b8001cd88bcea91f 100644 (file)
@@ -229,51 +229,6 @@ mtime_t date_Decrement( date_t *p_date, uint32_t i_nb_samples )
     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.
  */