$NetBSD: patch-av,v 1.1 2014/12/13 11:15:45 wiz Exp $ --- include/vlc_common.h.orig 2013-06-24 18:00:38.000000000 +0000 +++ include/vlc_common.h @@ -47,6 +47,9 @@ #include #include #include +#ifdef __NetBSD__ +#include +#endif #ifndef __cplusplus # include @@ -539,6 +542,8 @@ static inline unsigned ctz (unsigned x) #endif } +#if !defined(__NetBSD_Version__) || (__NetBSD_Version__ < 599001600) + /** Bit weight */ VLC_USED static inline unsigned popcount (unsigned x) @@ -567,6 +572,7 @@ static inline unsigned parity (unsigned return x & 1; #endif } +#endif /* NetBSD < 5.99.16 */ #ifdef __OS2__ # undef bswap16 @@ -574,6 +580,8 @@ static inline unsigned parity (unsigned # undef bswap64 #endif +#ifndef __NetBSD__ + /** Byte swap (16 bits) */ VLC_USED static inline uint16_t bswap16 (uint16_t x) @@ -622,6 +630,7 @@ static inline uint64_t bswap64 (uint64_t #endif } +#endif /* NetBSD */ /* Free and set set the variable to NULL */ #define FREENULL(a) do { free( a ); a = NULL; } while(0)