shithub: dav1d

Download patch

ref: 227b4d38aec4bc14fe0a2cfc06b18357cfbfdb9c
parent: 36f6d83c282b849f8d1b6588f636a94c2bbfc2b7
author: Janne Grunau <janne-vlc@jannau.net>
date: Sat Mar 21 11:41:31 EDT 2020

meson/android: undefine _FILE_OFFSET_BITS if fseeko is not available

--- a/meson.build
+++ b/meson.build
@@ -133,6 +133,21 @@
     endif
 endif
 
+# check for fseeko on android. It is not always available if _FILE_OFFSET_BITS is defined to 64
+have_fseeko = true
+if host_machine.system() == 'android'
+    if not cc.has_function('fseeko', prefix : '#include <stdio.h>', args : test_args)
+        if cc.has_function('fseeko', prefix : '#include <stdio.h>', args : test_args + ['-U_FILE_OFFSET_BITS'])
+            warning('Files larger than 2 gigabytes might not be supported in the dav1d CLI tool.')
+            add_project_arguments('-U_FILE_OFFSET_BITS', language: 'c')
+        elif get_option('enable_tools')
+            error('dav1d CLI tool needs fseeko()')
+        else
+            have_fseeko = false
+        endif
+    endif
+endif
+
 libdl_dependency = []
 if host_machine.system() == 'linux'
     libdl_dependency = cc.find_library('dl', required : false)
--- a/tests/libfuzzer/meson.build
+++ b/tests/libfuzzer/meson.build
@@ -26,6 +26,10 @@
 # Build definition for the dav1d fuzzing binaries
 #
 
+if fuzzing_engine == 'none' and not have_fseeko
+    subdir_done()
+endif
+
 dav1d_fuzzer_sources =  files('dav1d_fuzzer.c')
 fuzzer_ldflags = []
 fuzzer_link_lang = {}