Permalink
Browse files

Define bswap_* for use with sys/endian.h

Seems FreeBSD's macros are bswap16(), bswap32() and bswap64().
  • Loading branch information...
Beirdo committed May 9, 2012
1 parent 77d006b commit 3b62c77e78054c5b94864fb8c3db4fd8a53e8f81
Showing with 9 additions and 0 deletions.
  1. +9 −0 mythtv/libs/libmythbase/bswap.h
@@ -7,6 +7,15 @@
# include <byteswap.h> /* bswap_16|32|64 */
#elif HAVE_SYS_ENDIAN_H
# include <sys/endian.h>
+# if !defined(bswap_16) && defined(bswap16)
+# define bswap_16(x) bswap16(x)
+# endif
+# if !defined(bswap_32) && defined(bswap32)
+# define bswap_32(x) bswap32(x)
+# endif
+# if !defined(bswap_64) && defined(bswap64)
+# define bswap_64(x) bswap64(x)
+# endif
#elif CONFIG_DARWIN
# include <libkern/OSByteOrder.h>
# define bswap_16(x) OSSwapInt16(x)

0 comments on commit 3b62c77

Please sign in to comment.