Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on FreeBSD/aarch64 #581

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions galerautils/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ if not crc32c_no_hardware:

int main()
{
#if defined(__linux__)
(void)getauxval(AT_HWCAP);
#endif

(void)__crc32b(0, 0);
(void)__crc32h(0, 0);
Expand Down
13 changes: 9 additions & 4 deletions galerautils/src/gu_byteswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@ static GU_FORCE_INLINE uint64_t GU_ROTL64 (uint64_t x, int8_t r)
# define gu_bswap32 _OSSwapInt32
# define gu_bswap64 _OSSwapInt64
#elif defined(__FreeBSD__)
/* do not use bswapXX, because gcc44 gives old-style cast warnings */
# define gu_bswap16 __bswap16_var
# define gu_bswap32 __bswap32_var
# define gu_bswap64 __bswap64_var
# if defined(__aarch64__) || defined(__arm__)
# define gu_bswap16 bswap16
# define gu_bswap32 bswap32
# define gu_bswap64 bswap64
# else
# define gu_bswap16 __bswap16_var
# define gu_bswap32 __bswap32_var
# define gu_bswap64 __bswap64_var
# endif // __FreeBSD__
#elif defined(__sun__)
# define gu_bswap16 BSWAP_16
# define gu_bswap32 BSWAP_32
Expand Down