From c7659332cb3aae43cde1cf3e18fe7f44a42cd585 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Wed, 2 Sep 2020 09:51:54 +0200 Subject: [PATCH] Set _FILE_OFFSET_BITS to 64 This allows for operating on large files when compiled in 32-bit mode. Fixes #649. --- cmake/config.h.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/config.h.in b/cmake/config.h.in index 9e764223d6..e264cfba48 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -42,6 +42,11 @@ # define _XOPEN_SOURCE_EXTENDED #endif +// Handle large files when compiled in 32-bit mode. +#ifndef _FILE_OFFSET_BITS +# define _FILE_OFFSET_BITS 64 +#endif + // clang-format off #cmakedefine _WIN32_WINNT @_WIN32_WINNT@ // clang-format on