From c06409b7469bf9165108afefb71e0339c9b38872 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 4 Apr 2026 15:51:55 +0100 Subject: [PATCH] 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?) --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3eb229a..d611add 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,15 @@ endif() function(aaru_enable_large_file_support target) if(WIN32) 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() target_compile_definitions(${target} PRIVATE _FILE_OFFSET_BITS=64