diff --git a/CMakeLists.txt b/CMakeLists.txt index bf235bb9e..11b4563ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -326,6 +326,11 @@ if(WIN32) endif() endif() +if(NOT WIN32 AND NOT APPLE) + # Enable POSIX extensions such as `readlink` and `ftruncate`. + add_definitions(-D_POSIX_C_SOURCE=200809L) +endif() + if(HAIKU) target_link_libraries(devilutionx PRIVATE network) endif()