diff --git a/src/define.h b/src/define.h index 399a7b19..307ae57b 100644 --- a/src/define.h +++ b/src/define.h @@ -80,18 +80,21 @@ SCCP_INLINE unsigned short __bswap_16(unsigned short x) { return (x >> 8) | (x << 8); } +#define bswap_16(x) __bswap_16 (x) # endif # ifndef HAVE_BSWAP_32 SCCP_LINE unsigned int __bswap_32(unsigned int x) { return (__bswap_16(x & 0xffff) << 16) | (__bswap_16(x >> 16)); } +#define bswap_32(x) __bswap_32 (x) # endif # ifndef HAVE_BSWAP_64 SCCP_LINE unsigned long long __bswap_64(unsigned long long x) { return (((unsigned long long) __bswap_32(x & 0xffffffffull)) << 32) | (__bswap_32(x >> 32)); } +#define bswap_64(x) __bswap_64 (x) # endif # endif #endif @@ -103,10 +106,10 @@ SCCP_LINE unsigned long long __bswap_64(unsigned long long x) #define htolel(x) (x) #define htoles(x) (x) #else -#define letohs(x) __bswap_16(x) -#define htoles(x) __bswap_16(x) -#define letohl(x) __bswap_32(x) -#define htolel(x) __bswap_32(x) +#define letohs(x) bswap_16(x) +#define htoles(x) bswap_16(x) +#define letohl(x) bswap_32(x) +#define htolel(x) bswap_32(x) #endif #define SCCP_TECHTYPE_STR "SCCP"