[vlc-commits] vlc_tick: use a macro for vlc_tick_from_timeval()

Steve Lhomme git at videolan.org
Wed Jul 4 18:13:45 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul  4 18:13:20 2018 +0200| [df23697fbf323c03baa4a139444de25d064b7fe5] | committer: Steve Lhomme

vlc_tick: use a macro for vlc_tick_from_timeval()

So we don't have to include extra headers for struct timeval.

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

 include/vlc_tick.h | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/include/vlc_tick.h b/include/vlc_tick.h
index 6f2176aad7..c923e78976 100644
--- a/include/vlc_tick.h
+++ b/include/vlc_tick.h
@@ -32,12 +32,6 @@
 #ifndef __VLC_MTIME_H
 # define __VLC_MTIME_H 1
 
-#ifdef _WIN32
-#include <winsock2.h>
-#else
-#include <sys/time.h>
-#endif
-
 /**
  * High precision date or time interval
  *
@@ -161,10 +155,8 @@ typedef int64_t msftime_t;
 #define MSFTIME_FROM_VLC_TICK(vtk)  ((vtk)  * INT64_C(10000000) / CLOCK_FREQ)
 #endif /* CLOCK_FREQ / 10000000 */
 
-static inline vlc_tick_t vlc_tick_from_timeval(const struct timeval *tv)
-{
-    return vlc_tick_from_sec( tv->tv_sec ) + VLC_TICK_FROM_US( tv->tv_usec );
-}
+#define vlc_tick_from_timeval(tv) \
+    (vlc_tick_from_sec( (tv)->tv_sec ) + VLC_TICK_FROM_US( (tv)->tv_usec ))
 
 static inline vlc_tick_t vlc_tick_from_timespec(const struct timespec *tv)
 {



More information about the vlc-commits mailing list