Skip to content
This repository has been archived by the owner on Dec 22, 2024. It is now read-only.

Commit

Permalink
Fix big endian support
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaymar committed Mar 1, 2024
1 parent 56fb59f commit 2acefd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

#if __BIG_ENDIAN__
#define htole16(x) ((uint16_t)(((x) >> 8) & 0xFF) | ((uint16_t)((x)&0xFF) << 8))
#define htole32(x) (((uint32_t)htobe16(((x) >> 16) & 0xFFFF)) | ((uint32_t)htobe16((x)&0xFFFF) << 16))
#define htole64(x) (((uint64_t)htobe32(((x) >> 32) & 0xFFFFFFFF)) | ((uint64_t)htobe32((x)&0xFFFFFFFF) << 32))
#define htole32(x) (((uint32_t)htole16(((x) >> 16) & 0xFFFF)) | ((uint32_t)htole16((x)&0xFFFF) << 16))
#define htole64(x) (((uint64_t)htole32(((x) >> 32) & 0xFFFFFFFF)) | ((uint64_t)htole32((x)&0xFFFFFFFF) << 32))
#define htobe16(x) (x)
#define htobe32(x) (x)
#define htobe64(x) (x)
Expand Down

0 comments on commit 2acefd9

Please sign in to comment.