xiph / flac

Free Lossless Audio Codec
https://xiph.org/flac/
GNU Free Documentation License v1.3
1.58k stars 278 forks source link

disable fseeko in android before API 24 #691

Closed robUx4 closed 2 months ago

robUx4 commented 2 months ago

It can be linked in the NDK so check_function_exists() detects it. But it's only supporting _FILE_OFFSET_BITS=64 since Android API 24.

With NDK 26 it's no longer possible to build assuming the API is always available.

Fallback to 32-bit fseek/ftell whenever HAVE_FSEEKO is not set.

ktmf01 commented 2 months ago

Hi @robUx4,

Thanks for the PR. However, I don't know how to check this. There is another PR, #659, that tries to do the same, but simpler. Could you perhaps review that one, as it does not seem to rely on CMake?

robUx4 commented 2 months ago

It does not "rely" on CMake because the fix in the header will work for every autotools build that also detects fseeko() is not available.

The CMake fix is to handle the fseeko detection for Android too.

ktmf01 commented 2 months ago

Yes, but I guess that means the autotools build system would need a fix too? (I'm not saying it needs a fix in this PR though, I'm just wondering whether this means this PR only fixes it for CMake building) I have absolutely zero knowledge on building for Android.

robUx4 commented 2 months ago

autotools uses AC_FUNC_FSEEKO which is a common autoconf function: https://www.gnu.org/software/autoconf/manual/autoconf-2.66/html_node/Particular-Functions.html. It will define HAVE_FSEEKO accordingly.

I assume it's working with Android too, but we (VLC) do not have any contrib that use it (or rather we build with CMake for those who do).

ktmf01 commented 2 months ago

Thanks! I guess there's no patching for autotools necessary there indeed.