Index: bswap.h =================================================================== RCS file: /cvsroot/mplayer/main/bswap.h,v retrieving revision 1.5 diff -u -r1.5 bswap.h --- bswap.h 21 Oct 2004 11:55:19 -0000 1.5 +++ bswap.h 22 Feb 2005 16:33:45 -0000 @@ -117,6 +117,18 @@ #endif /* !HAVE_BYTESWAP_H */ +static float inline bswap_flt(float x) { + uint32_t *t = (uint32_t *)(void *)&x; + *t = bswap_32(*t); + return x; +} + +static double inline bswap_dbl(double x) { + uint64_t *t = (uint64_t *)(void *)&x; + *t = bswap_64(*t); + return x; +} + // be2me ... BigEndian to MachineEndian // le2me ... LittleEndian to MachineEndian @@ -136,4 +148,16 @@ #define le2me_64(x) (x) #endif +#ifdef FP_BIGENDIAN +#define be2me_flt(x) (x) +#define be2me_dbl(x) (x) +#define le2me_flt(x) bswap_flt(x) +#define le2me_dbl(x) bswap_dbl(x) +#else +#define be2me_flt(x) bswap_flt(x) +#define be2me_dbl(x) bswap_dbl(x) +#define le2me_flt(x) (x) +#define le2me_dbl(x) (x) +#endif + #endif /* __BSWAP_H__ */