Skip to content

Commit

Permalink
CMake: Avoid using fseeko64/ftello64/etc on non-Linux
Browse files Browse the repository at this point in the history
off_t is always 64-bit on BSDs but Large File Support API is not supported.

ld: error: undefined symbol: fseeko64
>>> referenced by hash.c
>>>               hash.c.o:(filereader_seek) in archive lib/librcheevos.a

ld: error: undefined symbol: ftello64
>>> referenced by hash.c
>>>               hash.c.o:(filereader_tell) in archive lib/librcheevos.a

Based on https://github.com/citra-emu/citra/commit/26af2b644ce6
  • Loading branch information
jbeich committed Sep 9, 2023
1 parent d18dea4 commit 9472e7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Expand Up @@ -425,7 +425,9 @@ if(NOT MSVC)
endif()
add_definitions(-D_XOPEN_SOURCE=700)
add_definitions(-D_XOPEN_SOURCE_EXTENDED -D__BSD_VISIBLE=1 -D_BSD_SOURCE -D_DEFAULT_SOURCE)
add_definitions(-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64)
if(CMAKE_SYSTEM_NAME MATCHES "Linux|SunOS" OR MINGW)
add_definitions(-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64)
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD")
add_definitions(-D_NETBSD_SOURCE)
endif()
Expand Down

0 comments on commit 9472e7e

Please sign in to comment.