From f0da4dddc6f208be5862aac6e79bc311f1e696f3 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Sat, 1 Apr 2017 22:00:10 +0200 Subject: Fixed ftime for Windows --- src/htslib.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/htslib.c') diff --git a/src/htslib.c b/src/htslib.c index 54a98b0..92c7d44 100755 --- a/src/htslib.c +++ b/src/htslib.c @@ -68,7 +68,11 @@ Please visit our Website: http://www.httrack.com #include #include +#ifndef _WIN32 #include +#else +#include +#endif #include // pour utimbuf @@ -2575,6 +2579,7 @@ TStamp time_local(void) { // number of millisec since 1970 HTSEXT_API TStamp mtime_local(void) { #ifndef HTS_DO_NOT_USE_FTIME +#ifndef _WIN32 struct timeval tv; if (gettimeofday(&tv, NULL) != 0) { assert(! "gettimeofday"); @@ -2582,6 +2587,12 @@ HTSEXT_API TStamp mtime_local(void) { return (TStamp) (((TStamp) tv.tv_sec * (TStamp) 1000) + ((TStamp) tv.tv_usec / (TStamp) 1000000)); +#else + struct timeb B; + ftime(&B); + return (TStamp) (((TStamp) B.time * (TStamp) 1000) + + ((TStamp) B.millitm)); +#endif #else // not precise.. return (TStamp) (((TStamp) time_local() * (TStamp) 1000) -- cgit v1.2.3