Permalink
Browse files

I hope this is the last I see of bswap.h for a while.

Getting all the variations right is rather tiring.
  • Loading branch information...
1 parent 3b62c77 commit 812fcf711ab21cd0f1d6c5898d1a01b94492b0f8 @Beirdo Beirdo committed May 9, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 mythtv/libs/libmythbase/bswap.h
@@ -21,10 +21,12 @@
# define bswap_16(x) OSSwapInt16(x)
# define bswap_32(x) OSSwapInt32(x)
# define bswap_64(x) OSSwapInt64(x)
-#else
+#elif HAVE_BIGENDIAN
# error Byte swapping functions not defined for this platform
#endif
+#ifdef bswap_32
+// TODO: Any reason we choose not to use bswap_64 for this?
static __inline__ double bswap_dbl(double x)
{
union {
@@ -36,5 +38,6 @@ static __inline__ double bswap_dbl(double x)
r.l[1] = bswap_32(w.l[0]);
return r.d;
}
+#endif
#endif /* ndef MYTHTV_BSWAP_H */

0 comments on commit 812fcf7

Please sign in to comment.