[vlc-commits] Remove unused gettimeofday() Win32 replacement

Rémi Denis-Courmont git at videolan.org
Thu Jul 14 19:55:32 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 14 20:46:51 2011 +0300| [a4d304c79393f0acc9b4519792d62b7ebb72ea3f] | committer: Rémi Denis-Courmont

Remove unused gettimeofday() Win32 replacement

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a4d304c79393f0acc9b4519792d62b7ebb72ea3f
---

 configure.ac     |    2 +-
 src/misc/mtime.c |   45 ---------------------------------------------
 2 files changed, 1 insertions(+), 46 deletions(-)

diff --git a/configure.ac b/configure.ac
index c5bf290..24a18ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.])
diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index d3d20e8..da0d8bf 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -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.
  */



More information about the vlc-commits mailing list