From 90c4e155dd0acf79f4f725c9dcd985304824c156 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 5 Nov 2020 11:55:34 -0800 Subject: portability.h: ensure _FILE_OFFSET_BITS=64 takes effect. I added a #include above this, which caused subtle breakages on 32-bit systems. Move it to the top of the file to fix it and avoid making a similar mistake in future. --- lib/portability.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/portability.h b/lib/portability.h index 05a449ee..5886f63f 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -4,6 +4,10 @@ // in specific compiler, library, or OS versions, localize all that here // and in portability.c +// Always use long file support. +// This must come before we #include any system header file to take effect! +#define _FILE_OFFSET_BITS 64 + // For musl #define _ALL_SOURCE #include @@ -30,9 +34,6 @@ #define printf_format #endif -// Always use long file support. -#define _FILE_OFFSET_BITS 64 - // This isn't in the spec, but it's how we determine what libc we're using. // Types various replacement prototypes need. -- cgit v1.2.3