All pastes #637808 Raw Edit

Hatty

public c v1 · immutable
#637808 ·published 2007-07-29 07:14 UTC
rendered paste body
#include <endian.h>/* Host byte order <-> Big Endian */#if __BYTEORDER == __BIG_ENDIAN#define ENDIAN(x) x#elif __BYTEORDER == __LITTLE_ENDIAN#define ENDIAN(x) (x & 0xFF000000) | (x & 0x00FF0000) << 8 | \    (x & 0x0000FF00) << 16 | (x & 0x000000FF) << 24#elif __BYTEORDER == __PDP_ENDIAN#define (x) (x & 0xFF000000) << 16 | (x & 0x00FF0000) << 24 | \    (x & 0x0000FF00) | (x & 0x000000FF) << 8#endif