void-packages/srcpkgs/efivar/files/bswap_constant.h

14 lines
433 B
C

#ifndef _BSWAP_CONSTANT_H_
#define _BSWAP_CONSTANT_H_
/* Swap bytes in 16 bit value. */
#define __bswap_constant_16(x) \
((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
/* Swap bytes in 32 bit value. */
#define __bswap_constant_32(x) \
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#endif /* _BSWAP_CONSTANT_H_ */