-#if defined (__ppc__)
-#include "architecture/ppc/byte_order.h"
-#elif defined (__i386__)
-#include "architecture/i386/byte_order.h"
-#else
-#error architecture not supported
-#endif
-
-/*
- * Identify the byte order
- * of the current host.
- */
-
-enum NXByteOrder {
- NX_UnknownByteOrder,
- NX_LittleEndian,
- NX_BigEndian
-};
-
-static __inline__
-enum NXByteOrder
-NXHostByteOrder(void)
-{
- unsigned int _x;
-
- _x = (NX_BigEndian << 24) | NX_LittleEndian;
-
- return ((enum NXByteOrder)*((unsigned char *)&_x));
-}
-
-/*
- * The predicated versions
- * are defined here in terms
- * of the unpredicated ones.
- */
-
-#if __BIG_ENDIAN__
-
-static __inline__
-unsigned short
-NXSwapBigShortToHost(
- unsigned short x
-)
-{
- return (x);
-}
-
-static __inline__
-unsigned int
-NXSwapBigIntToHost(
- unsigned int x
-)
-{
- return (x);
-}
-
-static __inline__
-unsigned long
-NXSwapBigLongToHost(
- unsigned long x
-)
-{
- return (x);
-}
-
-static __inline__
-unsigned long long
-NXSwapBigLongLongToHost(
- unsigned long long x
-)
-{
- return (x);
-}
-
-#ifndef KERNEL
-
-static __inline__
-double
-NXSwapBigDoubleToHost(
- NXSwappedDouble x
-)
-{
- return NXConvertSwappedDoubleToHost(x);
-}
-
-static __inline__
-float
-NXSwapBigFloatToHost(
- NXSwappedFloat x
-)
-{
- return NXConvertSwappedFloatToHost(x);
-}
-
-#endif /* KERNEL */
-
-static __inline__
-unsigned short
-NXSwapHostShortToBig(
- unsigned short x
-)
-{
- return (x);
-}
-
-static __inline__
-unsigned int
-NXSwapHostIntToBig(
- unsigned int x
-)
-{
- return (x);
-}
-
-static __inline__
-unsigned long
-NXSwapHostLongToBig(
- unsigned long x
-)
-{
- return (x);
-}
-