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/htsglobal.h | 4 ++-- src/htslib.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/htsglobal.h b/src/htsglobal.h index 42e9b98..58c94b1 100644 --- a/src/htsglobal.h +++ b/src/htsglobal.h @@ -36,8 +36,8 @@ Please visit our Website: http://www.httrack.com #define HTTRACK_GLOBAL_DEFH // Version (also check external version information) -#define HTTRACK_VERSION "3.48-24" -#define HTTRACK_VERSIONID "3.48.24" +#define HTTRACK_VERSION "3.49-1" +#define HTTRACK_VERSIONID "3.49.1" #define HTTRACK_AFF_VERSION "3.x" #define HTTRACK_LIB_VERSION "2.0" 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