Browse Source

Add missing 16-bit byteswap macros

Luke Dashjr 12 years ago
parent
commit
617d106ddd
1 changed files with 4 additions and 0 deletions
  1. 4 0
      miner.h

+ 4 - 0
miner.h

@@ -144,19 +144,23 @@ static inline int fsync (int fd)
 #  define htole16(x) (x)
 #  define htole32(x) (x)
 #  define htole64(x) (x)
+#  define htobe16(x) bswap_16(x)
 #  define htobe32(x) bswap_32(x)
 #  define htobe64(x) bswap_64(x)
 # else
 #  define htole16(x) bswap_16(x)
 #  define htole32(x) bswap_32(x)
 #  define htole64(x) bswap_64(x)
+#  define htobe16(x) (x)
 #  define htobe32(x) (x)
 #  define htobe64(x) (x)
 # endif
 #endif
 #ifndef be32toh
+# define le16toh(x) htole16(x)
 # define le32toh(x) htole32(x)
 # define le64toh(x) htole64(x)
+# define be16toh(x) htobe16(x)
 # define be32toh(x) htobe32(x)
 # define be64toh(x) htobe64(x)
 #endif