Browse Source

Partial-Merge commit 'a8e1ebb' into bfgminer

Only add htole16, but reorder the other functions to fit
Luke Dashjr 13 years ago
parent
commit
dc603790f4
1 changed files with 10 additions and 8 deletions
  1. 10 8
      miner.h

+ 10 - 8
miner.h

@@ -155,23 +155,25 @@ static inline int fsync (int fd)
  * the others also won't exist */
 #ifndef htobe32
 # if __BYTE_ORDER == __LITTLE_ENDIAN
-#  define be32toh(x) bswap_32(x)
-#  define be64toh(x) bswap_64(x)
-#  define htobe32(x) bswap_32(x)
-#  define htobe64(x) bswap_64(x)
 #  define le32toh(x) (x)
 #  define le64toh(x) (x)
+#  define htole16(x) (x)
 #  define htole32(x) (x)
 #  define htole64(x) (x)
+#  define be32toh(x) bswap_32(x)
+#  define be64toh(x) bswap_64(x)
+#  define htobe32(x) bswap_32(x)
+#  define htobe64(x) bswap_64(x)
 # elif __BYTE_ORDER == __BIG_ENDIAN
-#  define be32toh(x) (x)
-#  define be64toh(x) (x)
-#  define htobe32(x) (x)
-#  define htobe64(x) (x)
 #  define le32toh(x) bswap_32(x)
 #  define le64toh(x) bswap_64(x)
+#  define htole16(x) bswap_16(x)
 #  define htole32(x) bswap_32(x)
 #  define htole64(x) bswap_64(x)
+#  define be32toh(x) (x)
+#  define be64toh(x) (x)
+#  define htobe32(x) (x)
+#  define htobe64(x) (x)
 #else
 #error UNKNOWN BYTE ORDER
 #endif