vlc/vlc-3.0 | branch: master | Kamil Rytarowski <n...@gmx.com> | Mon Mar 12 
15:10:00 2018 +0100| [535aed6be3736e3ddf390ae41c039b0ffc4f05f3] | committer: 
Thomas Guillem

Make vlc_common.h compatible with NetBSD

Disable calls that are already handled by the NetBSD libc:
 - popcount(3)
 - popcountll(3)
 - bswap16(3)
 - bswap32(3)
 - bswap64(3)

These functions were renamed to vlc_* in HEAD (vlc-4.x) and since
they are set in stone in the stable releases use ifdef NetBSD here.

This corrects fatal build issues reported on NetBSD.

Signed-off-by: Thomas Guillem <tho...@gllm.fr>

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

 include/vlc_common.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 936df33bb6..12a36ec5ce 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -556,6 +556,7 @@ static inline unsigned (ctz)(unsigned x)
 #endif
 }
 
+#if !defined(__NetBSD__)
 /** Bit weight */
 VLC_USED
 static inline unsigned (popcount)(unsigned x)
@@ -589,6 +590,7 @@ static inline int (popcountll)(unsigned long long x)
     return count;
 #endif
 }
+#endif
 
 VLC_USED
 static inline unsigned (parity)(unsigned x)
@@ -602,6 +604,7 @@ static inline unsigned (parity)(unsigned x)
 #endif
 }
 
+#if !defined(__NetBSD__)
 /** Byte swap (16 bits) */
 VLC_USED
 static inline uint16_t (bswap16)(uint16_t x)
@@ -649,6 +652,7 @@ static inline uint64_t (bswap64)(uint64_t x)
          | ((x & 0xFF00000000000000ULL) >> 56);
 #endif
 }
+#endif
 
 /* Integer overflow */
 static inline bool uadd_overflow(unsigned a, unsigned b, unsigned *res)

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to