Skip to content

Commit f784ced

Browse files
authored
endianswap: fix 64-bit byteswap macro on weird compilers
1 parent d300a31 commit f784ced

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

endianswap.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
5959

6060
# define BYTESWAP_64(x) \
6161
(((x) >> 56) | \
62-
(((x) & 0x00FF000000000000ULL) >> 48) | \
63-
(((x) & 0x0000FF0000000000ULL) >> 40) | \
64-
(((x) & 0x000000FF00000000ULL) >> 32) | \
65-
(((x) & 0x00000000FF000000ULL) << 32) | \
66-
(((x) & 0x0000000000FF0000ULL) << 40) | \
67-
(((x) & 0x000000000000FF00ULL) << 48) | \
62+
(((x) & 0x00FF000000000000ULL) >> 40) | \
63+
(((x) & 0x0000FF0000000000ULL) >> 24) | \
64+
(((x) & 0x000000FF00000000ULL) >> 8) | \
65+
(((x) & 0x00000000FF000000ULL) << 8) | \
66+
(((x) & 0x0000000000FF0000ULL) << 24) | \
67+
(((x) & 0x000000000000FF00ULL) << 40) | \
6868
(((x) & 0x00000000000000FFULL) << 56))
6969

7070
#endif

0 commit comments

Comments
 (0)