From 1ae45188468934f57c9c71fb015e8bf73acf374f Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Wed, 2 Oct 2024 06:59:00 +0100 Subject: [PATCH] DLONG_PREFIX is %ld on x86_64 LP64 GCC14 loud default warnings fix --- utils/magic.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/magic.h b/utils/magic.h index ca9e1eec..eebcd253 100644 --- a/utils/magic.h +++ b/utils/magic.h @@ -49,7 +49,13 @@ ERROR: Cannot compile without knowing the size of a pointer. See utils/magic.h typedef int64_t dlong; #define DLONG_MAX INT64_MAX #define DLONG_MIN INT64_MIN +#if (defined(__x86_64__) && !defined(_WIN64)) +/* gcc x86_64 defines int64_t as 'long int' on LP64 */ +#define DLONG_PREFIX "l" +#else +/* for 32bit and 64bit LLP64 (_WIN64) systems */ #define DLONG_PREFIX "ll" +#endif /* --------------------- Universal pointer type ----------------------- */