libdvdread on FreeBSD

Matthew Reimer <[email protected]>
Newsgroups gmane.comp.video.ogle.devel
Organization VPOP Technologies, Inc.
Message-ID <[email protected]>
libdvdread doesn't compile correctly on FreeBSD, I think because of an 
#ifdef mistake. The following condition in dvdread/bswap.h occurs twice 
consecutively:

#elif defined(__FreeBSD__) && __FreeBSD_version >= 470000
#include <sys/endian.h>
#define B2N_16(x) x = be16toh(x)
#define B2N_32(x) x = be32toh(x)
#define B2N_64(x) x = be64toh(x)

/* This is a slow but portable implementation, it has multiple evaluation
  * problems so beware.
  * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such
  * functionality!
  */

#elif defined(__FreeBSD__) && __FreeBSD_version >= 470000
#include <sys/endian.h>
#define B2N_16(x) x = (be16toh(x))
#define B2N_32(x) x = (be32toh(x))
#define B2N_64(x) \
  x = ((((x) & 0xff00000000000000) >> 56) | \
       (((x) & 0x00ff000000000000) >> 40) | \
...

I couldn't find be64toh on my 4.7-stable system, so I went with the 
second set of defines and it seems to work fine. Someone with more 
FreeBSD clue might give a better solution.

Matt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.