From a4ad3e8ea85f81c33612ddde91e623fe344e0dd6 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Fri, 23 May 2014 14:07:29 +1200 Subject: [PATCH] Bug 1014613 - Unbreak build on BSDs after bug 908503. --- media/libstagefright/moz.build | 6 ++++++ media/libstagefright/ports/bsd/include/byteswap.h | 15 +++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 media/libstagefright/ports/bsd/include/byteswap.h diff --git a/media/libstagefright/moz.build b/media/libstagefright/moz.build index 4362580fea7..2e0d2e428a9 100644 --- a/media/libstagefright/moz.build +++ b/media/libstagefright/moz.build @@ -21,6 +21,12 @@ elif CONFIG['OS_TARGET'] == 'Darwin': DEFINES['HAVE_SYS_UIO_H'] = True DEFINES['off64_t'] = 'off_t' LOCAL_INCLUDES += [ 'ports/darwin/include' ] +elif CONFIG['OS_TARGET'] in ('DragonFly', 'FreeBSD', 'OpenBSD', 'NetBSD'): + if not CONFIG['OS_TARGET'] == 'NetBSD': + DEFINES['ENODATA'] = '-0x80000003' + DEFINES['HAVE_SYS_UIO_H'] = True + DEFINES['off64_t'] = 'off_t' + LOCAL_INCLUDES += [ 'ports/bsd/include' ] else: DEFINES['HAVE_SYS_UIO_H'] = True if CONFIG['OS_TARGET'] == 'Linux': diff --git a/media/libstagefright/ports/bsd/include/byteswap.h b/media/libstagefright/ports/bsd/include/byteswap.h new file mode 100644 index 00000000000..5bd379a8cfd --- /dev/null +++ b/media/libstagefright/ports/bsd/include/byteswap.h @@ -0,0 +1,15 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +#ifndef BYTESWAP_H_ +#define BYTESWAP_H_ + +#include + +#ifdef __OpenBSD__ +#define bswap_16(x) swap16(x) +#else +#define bswap_16(x) bswap16(x) +#endif + +#endif