[vlc-devel] [PATCH 2/2] timeval is officially defined in winsock2.h on Windows

Steve Lhomme robux4 at gmail.com
Mon Aug 3 15:39:21 CEST 2015


see https://msdn.microsoft.com/en-us/library/windows/desktop/ms740560%28v=vs.85%29.aspx
---
 src/misc/mtime.c            | 6 +++++-
 src/video_output/snapshot.c | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index 46939dc..adff362 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -43,7 +43,11 @@
 #if (_POSIX_TIMERS > 0)
 # include <time.h> /* clock_gettime() */
 #else
-# include <sys/time.h>
+# ifdef _WIN32
+#  include <winsock2.h>
+# else
+#  include <sys/time.h>
+# endif
 #endif
 
 /**
diff --git a/src/video_output/snapshot.c b/src/video_output/snapshot.c
index 7c8b527..b115402 100644
--- a/src/video_output/snapshot.c
+++ b/src/video_output/snapshot.c
@@ -29,7 +29,11 @@
 #include <assert.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#else
 #include <sys/time.h>
+#endif
 #include <dirent.h>
 #include <time.h>
 
-- 
2.4.2




More information about the vlc-devel mailing list