[vlc-devel] [PATCH] nfs: move the structure timezone definition in the header for MS clang

Steve Lhomme robux4 at videolabs.io
Mon Jul 11 13:33:59 CEST 2016


clang doesn't match undefined structure pointers between files and complains
---
 contrib/src/nfs/clang.patch | 32 ++++++++++++++++++++++++++++++++
 contrib/src/nfs/rules.mak   |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 contrib/src/nfs/clang.patch

diff --git a/contrib/src/nfs/clang.patch b/contrib/src/nfs/clang.patch
new file mode 100644
index 0000000..ff7455d
--- /dev/null
+++ b/contrib/src/nfs/clang.patch
@@ -0,0 +1,32 @@
+--- nfs/win32/win32_compat.c	2016-02-01 01:06:44.000000000 +0100
++++ nfs/win32/win32_compat.c.clang	2016-07-04 14:01:26.872414200 +0200
+@@ -157,11 +157,13 @@ int win32_poll(struct pollfd *fds, unsig
+ #endif
+  
+ #ifndef __MINGW32__
++#ifndef __clang__
+ struct timezone 
+ {
+   int  tz_minuteswest; /* minutes W of Greenwich */
+   int  tz_dsttime;     /* type of dst correction */
+ };
++#endif /* __clang__ */
+  
+ int win32_gettimeofday(struct timeval *tv, struct timezone *tz)
+ {
+--- nfs/win32/win32_compat.h	2016-07-04 12:40:42.810323200 +0200
++++ nfs/win32/win32_compat.h.clang	2016-07-05 12:38:32.285173000 +0200
+@@ -102,6 +102,13 @@ struct pollfd {
+ #define close closesocket
+ #define ioctl ioctlsocket
+ 
++#if defined(__clang__) && !defined (__MINGW32__)
++struct timezone {
++  int  tz_minuteswest; /* minutes W of Greenwich */
++  int  tz_dsttime;     /* type of dst correction */
++};
++#endif
++
+ /* Wrapper macros to call misc. functions win32 is missing */
+ #ifndef HAVE_POLL_H
+ #define poll(x, y, z)        win32_poll(x, y, z)
diff --git a/contrib/src/nfs/rules.mak b/contrib/src/nfs/rules.mak
index 013a4a0..6da91d6 100644
--- a/contrib/src/nfs/rules.mak
+++ b/contrib/src/nfs/rules.mak
@@ -16,6 +16,7 @@ nfs: libnfs-$(NFS_VERSION).tar.gz .sum-nfs
 	$(UNPACK)
 	mv libnfs-libnfs-$(NFS_VERSION) libnfs-$(NFS_VERSION)
 	$(APPLY) $(SRC)/nfs/Android-statvfs.patch
+	$(APPLY) $(SRC)/nfs/clang.patch
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 
-- 
2.8.2



More information about the vlc-devel mailing list