bigend.h 462 B

123456789101112131415161718192021
  1. #ifndef _bigend_h
  2. #define _bigend_h
  3. #if defined(__cplusplus)
  4. extern "C" {
  5. #endif
  6. #define invert2(x) ( (((x)>>8)&0x00ff) | (((x)<<8)&0xff00) )
  7. #define invert4(x) ( ((invert2(x)&0x0000ffff)<<16) | (invert2((x>>16))&0x0000ffff) )
  8. #define highByte(x) (unsigned char)x
  9. #define mid2Byte(x) (unsigned char)(x >> 8)
  10. #define mid1Byte(x) (unsigned char)(x >> 16)
  11. #define lowByte(x) (unsigned char)(x >> 24)
  12. #define SWAPENDS 1
  13. #if defined(__cplusplus)
  14. }
  15. #endif
  16. #endif