]> git.ipfire.org Git - thirdparty/xz.git/commit
tuklib_integer: Fix building on OpenBSD/sparc64 that uses GCC 4.2
authorLasse Collin <lasse.collin@tukaani.org>
Fri, 7 Jun 2024 12:47:20 +0000 (15:47 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 6 Sep 2024 15:51:59 +0000 (18:51 +0300)
commit6f66155e01a6467e70db48cddbe790bdb8d87754
tree24a7f1edee0339851b47abc7e548806d305fd708
parent5522759d31e0f1513fffbdf39a955f12d373f121
tuklib_integer: Fix building on OpenBSD/sparc64 that uses GCC 4.2

GCC 4.2 doesn't have __builtin_bswap16() and friends so tuklib_integer.h
tries to use OS-specific byte swap methods instead. On OpenBSD those
macros are swap16/32/64 instead of bswap16/32/64 like on other *BSDs
and Darwin.

An alternative to "#ifdef __OpenBSD__" could be "#ifdef swap16" as it
is a macro. But since OpenBSD seems to be a special case under this
special case of "*BSDs and Darwin", checking for __OpenBSD__ seems
the more conservative choice now.

Thanks to Christian Weisgerber and Brad Smith who both submitted
the same patch a few hours apart.

Co-authored-by: Christian Weisgerber <naddy@mips.inka.de>
Co-authored-by: Brad Smith <brad@comstyle.com>
Closes: https://github.com/tukaani-project/xz/pull/126
(cherry picked from commit 04b23addf3733873667675df2439725f076c2f36)
src/common/tuklib_integer.h