[x264-devel] [Git][videolan/x264][master] Fix build with Android NDK and API < 24 for 32-bit targets

Anton Mitrofanov (@BugMaster) gitlab at videolan.org
Wed Oct 23 19:20:30 UTC 2024



Anton Mitrofanov pushed to branch master at VideoLAN / x264


Commits:
3a21e97b by Anton Mitrofanov at 2024-10-22T22:59:00+03:00
Fix build with Android NDK and API < 24 for 32-bit targets

fseeko() is not available before API 24 with _FILE_OFFSET_BITS=64.
x264.c: x264cli.h must be first as it contains _FILE_OFFSET_BITS define.

- - - - -


2 changed files:

- configure
- x264.c


Changes:

=====================================
configure
=====================================
@@ -645,6 +645,9 @@ if [ $compiler = GNU ]; then
     if cc_check '' -Werror=ignored-attributes ; then
         CHECK_CFLAGS="$CHECK_CFLAGS -Werror=ignored-attributes"
     fi
+    if cc_check '' -Werror=implicit-function-declaration ; then
+        CHECK_CFLAGS="$CHECK_CFLAGS -Werror=implicit-function-declaration"
+    fi
 fi
 
 libm=""
@@ -1382,7 +1385,7 @@ if [ $SYS = WINDOWS -a $ARCH = X86 -a $compiler = GNU ] ; then
     cc_check '' -fno-zero-initialized-in-bss && CFLAGS="$CFLAGS -fno-zero-initialized-in-bss"
 fi
 
-if cc_check "stdio.h" "" "fseeko(stdin,0,0);" ; then
+if cc_check "stdio.h" "-D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64" "fseeko(stdin,0,0);" ; then
     define fseek fseeko
     define ftell ftello
 elif cc_check "stdio.h" "" "fseeko64(stdin,0,0);" ; then


=====================================
x264.c
=====================================
@@ -32,6 +32,11 @@
 /* The following two defines must be located before the inclusion of any system header files. */
 #define WINVER       0x0500
 #define _WIN32_WINNT 0x0500
+#endif
+
+#include "x264cli.h"
+
+#ifdef _WIN32
 #include <windows.h>
 #include <io.h>       /* _setmode() */
 #include <fcntl.h>    /* _O_BINARY */
@@ -39,7 +44,6 @@
 
 #include <signal.h>
 #include <getopt.h>
-#include "x264cli.h"
 #include "input/input.h"
 #include "output/output.h"
 #include "filters/filters.h"



View it on GitLab: https://code.videolan.org/videolan/x264/-/commit/3a21e97bf23676a0bf4616df8bc2207c9fd7b1d3

-- 
View it on GitLab: https://code.videolan.org/videolan/x264/-/commit/3a21e97bf23676a0bf4616df8bc2207c9fd7b1d3
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the x264-devel mailing list