* src/od.c: Include endian.h.
(WORDS_BIGENDIAN): Remove definition.
(main): Use BYTE_ORDER, BIG_ENDIAN, LITTLE_ENDIAN instead of
WORDS_BIGENDIAN. Fix formatting.
#include <config.h>
#include <ctype.h>
+#include <endian.h>
#include <float.h>
#include <stdio.h>
#include <getopt.h>
#endif
};
-#ifndef WORDS_BIGENDIAN
-# define WORDS_BIGENDIAN 0
-#endif
-
/* Use native endianness by default. */
static bool input_swap;
case ENDIAN_OPTION:
switch (XARGMATCH ("--endian", optarg, endian_args, endian_types))
{
- case endian_big:
- input_swap = ! WORDS_BIGENDIAN;
- break;
- case endian_little:
- input_swap = WORDS_BIGENDIAN;
- break;
+ case endian_big:
+ input_swap = BYTE_ORDER != BIG_ENDIAN;
+ break;
+ case endian_little:
+ input_swap = BYTE_ORDER != LITTLE_ENDIAN;
+ break;
}
break;