bswap.h revision 1.1
1/* $NetBSD: bswap.h,v 1.1 1999/01/15 13:31:24 bouyer Exp $ */ 2 3/* Written by Manuel Bouyer. Public domain */ 4 5#ifndef _I386_BSWAP_H_ 6#define _I386_BSWAP_H_ 7 8#include <sys/cdefs.h> 9 10__BEGIN_DECLS 11#ifdef _KERNEL 12u_int16_t bswap16 __P((u_int16_t)); 13u_int32_t bswap32 __P((u_int32_t)); 14#else 15u_int16_t bswap16 __P((u_int16_t)) __RENAME(__bswap16); 16u_int32_t bswap32 __P((u_int32_t)) __RENAME(__bswap32); 17#endif 18u_int64_t bswap64 __P((u_int64_t)); 19__END_DECLS 20 21#ifdef __GNUC__ 22 23#include <machine/byte_swap.h> 24#define bswap16(x) __byte_swap_word(x) 25#define bswap32(x) __byte_swap_long(x) 26 27#endif /* __GNUC__ */ 28 29#endif /* _I386_BSWAP_H_ */ 30