Commit 873c06b0a3b2adee230fd42914b3866a0391f0b7
1 parent
021edd02
Move fseeko checks in configuration for Android build (fixes #950)
Detection of fseeko on Android ABI level < 24 gets a false positive if _FILE_OFFSET_BITS is not set first.
Showing
1 changed file
with
7 additions
and
2 deletions
libqpdf/CMakeLists.txt
| @@ -318,8 +318,6 @@ list(REMOVE_DUPLICATES dep_link_libraries) | @@ -318,8 +318,6 @@ list(REMOVE_DUPLICATES dep_link_libraries) | ||
| 318 | 318 | ||
| 319 | check_type_size(size_t SIZEOF_SIZE_T) | 319 | check_type_size(size_t SIZEOF_SIZE_T) |
| 320 | check_include_file("inttypes.h" HAVE_INTTYPES_H) | 320 | check_include_file("inttypes.h" HAVE_INTTYPES_H) |
| 321 | -check_symbol_exists(fseeko "stdio.h" HAVE_FSEEKO) | ||
| 322 | -check_symbol_exists(fseeko64 "stdio.h" HAVE_FSEEKO64) | ||
| 323 | check_symbol_exists(localtime_r "time.h" HAVE_LOCALTIME_R) | 321 | check_symbol_exists(localtime_r "time.h" HAVE_LOCALTIME_R) |
| 324 | check_symbol_exists(random "stdlib.h" HAVE_RANDOM) | 322 | check_symbol_exists(random "stdlib.h" HAVE_RANDOM) |
| 325 | 323 | ||
| @@ -362,6 +360,13 @@ if(LFS_WITH_MACROS AND NOT LFS_WITHOUT_MACROS) | @@ -362,6 +360,13 @@ if(LFS_WITH_MACROS AND NOT LFS_WITHOUT_MACROS) | ||
| 362 | set(_FILE_OFFSET_BITS 64) | 360 | set(_FILE_OFFSET_BITS 64) |
| 363 | endif() | 361 | endif() |
| 364 | 362 | ||
| 363 | +# fseeko may not exist with _FILE_OFFSET_BITS=64 but can exist with | ||
| 364 | +# _FILE_OFFSET_BITS unset or 32 (e.g. Android ARMv7 with NDK 26b and | ||
| 365 | +# API level < 24) so we need to test fseeko after testing for | ||
| 366 | +# _FILE_OFFSET_BITS. See https://github.com/qpdf/qpdf/issues/950. | ||
| 367 | +check_symbol_exists(fseeko "stdio.h" HAVE_FSEEKO) | ||
| 368 | +check_symbol_exists(fseeko64 "stdio.h" HAVE_FSEEKO64) | ||
| 369 | + | ||
| 365 | check_c_source_compiles( | 370 | check_c_source_compiles( |
| 366 | "#include <malloc.h> | 371 | "#include <malloc.h> |
| 367 | #include <stdio.h> | 372 | #include <stdio.h> |