build: remap POSIX large-file APIs to native 64-bit stdio functions for MSVC

Allows libFLAC to compile in MSVC (how do they do it upstream? do they?)
This commit is contained in:
2026-04-04 15:51:55 +01:00
parent 1681c4f1ec
commit c06409b746

View File

@@ -89,6 +89,15 @@ endif()
function(aaru_enable_large_file_support target) function(aaru_enable_large_file_support target)
if(WIN32) if(WIN32)
target_compile_definitions(${target} PRIVATE AARU_USE_WIN32_FILEIO64) target_compile_definitions(${target} PRIVATE AARU_USE_WIN32_FILEIO64)
# Some bundled third-party sources use POSIX large-file APIs directly.
# On MSVC, remap them to the native 64-bit stdio functions without
# modifying the vendored sources.
if(MSVC)
target_compile_definitions(${target} PRIVATE
fseeko=_fseeki64
ftello=_ftelli64)
endif()
else() else()
target_compile_definitions(${target} PRIVATE target_compile_definitions(${target} PRIVATE
_FILE_OFFSET_BITS=64 _FILE_OFFSET_BITS=64