[vlc-devel] [PATCH] Work around undetected functions

Steve Lhomme robux4 at videolabs.io
Sat Jan 30 09:26:26 CET 2016


From: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

autoconf doesn't detect some macro based versions
---
 compat/getpid.c | 4 ++++
 compat/lldiv.c  | 4 ++++
 compat/swab.c   | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/compat/getpid.c b/compat/getpid.c
index d6275e7..58b3aad 100644
--- a/compat/getpid.c
+++ b/compat/getpid.c
@@ -22,6 +22,8 @@
 # include <config.h>
 #endif
 
+#ifndef HAVE_GETPID
+
 #include <sys/types.h>
 #ifdef _WIN32
 # include <windows.h>
@@ -37,3 +39,5 @@ pid_t getpid (void)
 # error Unimplemented!
 #endif
 }
+
+#endif
\ No newline at end of file
diff --git a/compat/lldiv.c b/compat/lldiv.c
index 3931aac..2aaa82d 100644
--- a/compat/lldiv.c
+++ b/compat/lldiv.c
@@ -22,8 +22,12 @@
 # include <config.h>
 #endif
 
+#ifndef HAVE_LLDIV
+
 lldiv_t lldiv (long long num, long long denom)
 {
     lldiv_t d = { num / denom, num % demon, };
     return d;
 }
+
+#endif
\ No newline at end of file
diff --git a/compat/swab.c b/compat/swab.c
index 686faf8..042f90f 100644
--- a/compat/swab.c
+++ b/compat/swab.c
@@ -22,6 +22,8 @@
 # include <config.h>
 #endif
 
+#ifndef HAVE_SWAB
+
 #include <stdlib.h>
 #include <stdint.h>
 
@@ -41,3 +43,4 @@ void swab( const void *p_src_, void *p_dst_, ssize_t n )
     }
 }
 
+#endif
\ No newline at end of file
-- 
2.6.0.windows.1



More information about the vlc-devel mailing list