CMake: check fseeko after detecting HAVE_FILE_OFFSET_BITS

Closes #13264
This commit is contained in:
Jérôme Leclercq 2024-04-02 19:42:08 +02:00 коммит произвёл Daniel Stenberg
Родитель 1302aa6b50
Коммит 6b86471fe1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5CC908FDB71E12C2
1 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -1229,7 +1229,6 @@ check_symbol_exists(getifaddrs "${CURL_INCLUDES};stdlib.h" HAVE_GETIFADDRS)
check_symbol_exists(freeaddrinfo "${CURL_INCLUDES}" HAVE_FREEADDRINFO)
check_symbol_exists(pipe "${CURL_INCLUDES}" HAVE_PIPE)
check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE)
check_symbol_exists(fseeko "${CURL_INCLUDES};stdio.h" HAVE_FSEEKO)
check_symbol_exists(_fseeki64 "${CURL_INCLUDES};stdio.h" HAVE__FSEEKI64)
check_symbol_exists(getpeername "${CURL_INCLUDES}" HAVE_GETPEERNAME)
check_symbol_exists(getsockname "${CURL_INCLUDES}" HAVE_GETSOCKNAME)
@ -1239,10 +1238,6 @@ check_symbol_exists(setlocale "${CURL_INCLUDES}" HAVE_SETLOCALE)
check_symbol_exists(setmode "${CURL_INCLUDES}" HAVE_SETMODE)
check_symbol_exists(setrlimit "${CURL_INCLUDES}" HAVE_SETRLIMIT)
if(HAVE_FSEEKO)
set(HAVE_DECL_FSEEKO 1)
endif()
if(NOT MSVC OR (MSVC_VERSION GREATER_EQUAL 1900))
# earlier MSVC compilers had faulty snprintf implementations
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
@ -1305,6 +1300,15 @@ if(HAVE_FILE_OFFSET_BITS)
endif()
check_type_size("off_t" SIZEOF_OFF_T)
# fseeko may not exist with _FILE_OFFSET_BITS=64 but can exist with
# _FILE_OFFSET_BITS unset or 32 (e.g. Android ARMv7 with NDK 26b and API level < 24)
# so we need to test fseeko after testing for _FILE_OFFSET_BITS
check_symbol_exists(fseeko "${CURL_INCLUDES};stdio.h" HAVE_FSEEKO)
if(HAVE_FSEEKO)
set(HAVE_DECL_FSEEKO 1)
endif()
# include this header to get the type
set(CMAKE_REQUIRED_INCLUDES "${CURL_SOURCE_DIR}/include")
set(CMAKE_EXTRA_INCLUDE_FILES "curl/system.h")