Commit d1b200df authored by Damien Fouilleul's avatar Damien Fouilleul

misc/mtime.c: warning fixes, latest MinGW has gettimeofday()

parent d084716e
...@@ -129,8 +129,10 @@ static inline unsigned mprec( void ) ...@@ -129,8 +129,10 @@ static inline unsigned mprec( void )
static unsigned prec = 0; static unsigned prec = 0;
static volatile mtime_t cached_time = 0; static volatile mtime_t cached_time = 0;
#if (_POSIX_MONOTONIC_CLOCK - 0 < 0) #if defined( HAVE_CLOCK_NANOSLEEP )
# if (_POSIX_MONOTONIC_CLOCK - 0 < 0)
# define CLOCK_MONOTONIC CLOCK_REALTIME # define CLOCK_MONOTONIC CLOCK_REALTIME
# endif
#endif #endif
/** /**
...@@ -430,7 +432,10 @@ mtime_t date_Increment( date_t *p_date, uint32_t i_nb_samples ) ...@@ -430,7 +432,10 @@ mtime_t date_Increment( date_t *p_date, uint32_t i_nb_samples )
return p_date->date; return p_date->date;
} }
#ifndef HAVE_GETTIMEOFDAY
#ifdef WIN32 #ifdef WIN32
/* /*
* Number of micro-seconds between the beginning of the Windows epoch * Number of micro-seconds between the beginning of the Windows epoch
* (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970). * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970).
...@@ -467,9 +472,10 @@ static int gettimeofday (struct timeval *tv, void *tz ) ...@@ -467,9 +472,10 @@ static int gettimeofday (struct timeval *tv, void *tz )
tv->tv_usec = (long) (tim % 1000000L); tv->tv_usec = (long) (tim % 1000000L);
return (0); return (0);
} }
#endif
#endif
#endif
/** /**
* @return NTP 64-bits timestamp in host byte order. * @return NTP 64-bits timestamp in host byte order.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment