ref: 2f349ac84d0a14c9ce3302284c48e46a9b1eae3e
parent: 85481dcd197d3e6ed31f84e20bc106024311a47c
author: rrt <rrt>
date: Mon Dec 11 19:56:36 EST 2006
Duh. Move macro definitions to header.
--- a/src/misc.c
+++ b/src/misc.c
@@ -406,12 +406,6 @@
f[i]= l[n-i-1];
}
-/* Byte swappers, use optimized macros if available */
-#ifndef HAVE_BYTESWAP_H
-#define st_swapw(uw) (((uw >> 8) | (uw << 8)) & 0xffff)
-#define st_swapdw(udw) ((udw >> 24) | ((udw >> 8) & 0xff00) | ((udw << 8) & 0xff0000L) | (udw << 24))
-#endif
-
/* return swapped 32-bit float */
float st_swapf(float f)
{
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -100,8 +100,8 @@
#define st_swapw(x) bswap_16(x)
#define st_swapdw(x) bswap_32(x)
#else
-uint16_t st_swapw(uint16_t uw);
-uint32_t st_swapdw(uint32_t udw);
+#define st_swapw(uw) (((uw >> 8) | (uw << 8)) & 0xffff)
+#define st_swapdw(udw) ((udw >> 24) | ((udw >> 8) & 0xff00) | ((udw << 8) & 0xff0000L) | (udw << 24))
#endif
float st_swapf(float f);
uint32_t st_swap24(uint32_t udw);