From 6b6d3b37702edb4adf084ad05b72e7dbbd64e661 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 2 Dec 2024 21:28:32 +0300 Subject: [PATCH] 3rdparty: opusfile: wscript: hack building on Android with API level lower than 24 In API level 21 **and** _FILE_OFFSET_BITS == 64 we don't get fseeko/ftello functions. To avoid increasing API level, just set _FILE_OFFSET_BITS to some bogus value. Undefining it doesn't work as opusfile sets it to 64 automatically. --- 3rdparty/opusfile/wscript | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/3rdparty/opusfile/wscript b/3rdparty/opusfile/wscript index e758e0e8..ef0f5f8d 100644 --- a/3rdparty/opusfile/wscript +++ b/3rdparty/opusfile/wscript @@ -14,6 +14,12 @@ def configure(conf): conf.define('_CRT_SECURE_NO_DEPRECATE', 1) conf.define('_CRT_NONSTDC_NO_DEPRECATE', 1) + if conf.env.DEST_OS == 'android': + # HACKHACK: set it to 32 here because opusfile can't be built on Android SDK < 24 + # with _FILE_OFFSET_BITS 64 (which it sets automatically in src/internal.h) + # we are not (????) relying on this part of the API, so it should be harmless + conf.define('_FILE_OFFSET_BITS', 32) + def build(bld): sources = [ 'opusfile/src/info.c',