]> git.ipfire.org Git - thirdparty/zstd.git/commit
[zstd][android] Fix build with NDK r27 4107/head
authorAdenilson Cavalcanti <cavalcantii@chromium.org>
Mon, 29 Jul 2024 23:37:41 +0000 (16:37 -0700)
committerAdenilson Cavalcanti <cavalcantii@chromium.org>
Tue, 30 Jul 2024 00:13:58 +0000 (17:13 -0700)
commitc3c28c4d5a28bca93c97c4ce447f3c8ece42791d
tree70f4ca08ab35e2ee4a95d3a3ad59afd043314b99
parent43b713a2ce5d2e5ee530cf7f42054dfb3f6f5038
[zstd][android] Fix build with NDK r27

The NDK cross compiler declares the target as __linux (which is
not technically incorrect), which triggers the enablement of _GNU_SOURCE
in the newly added code that requires the presence of qsort_r() used
in the COVER dictionary code.

Even though the NDK uses llvm/libc, it doesn't declare qsort_r()
in the stdlib.h header.

The build fix is to only activate the _GNU_SOURCE macro if the OS is
*not* Android, as then we will fallback to the C90 compliant code.

This patch should solve the reported issue number #4103.
lib/common/zstd_deps.h
lib/dictBuilder/cover.c