From 746da6f2d91344ba598a66a25d73c788b88e552f Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Mon, 1 Feb 2021 00:45:37 +0200 Subject: [PATCH] Update SqBase.hpp --- module/SqBase.hpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/module/SqBase.hpp b/module/SqBase.hpp index 91d52dac..b582a58a 100644 --- a/module/SqBase.hpp +++ b/module/SqBase.hpp @@ -6,6 +6,7 @@ // ------------------------------------------------------------------------------------------------ #include #include +#include #include #include @@ -384,9 +385,16 @@ enum EntityType #define SQMOD_FORMAT_ATTR(mode, index, first) __attribute__ ((format(mode, index, first))) #ifdef _SQ64 - #define PRINT_SZ_FMT "llu" - #define PRINT_INT_FMT "lld" - #define PRINT_UINT_FMT "llu" + // Chances are (u)int64_t is defined as long and not long long + #ifdef SQMOD_OS_LINUX && (LONG_MAX == LLONG_MAX) + #define PRINT_SZ_FMT "lu" + #define PRINT_INT_FMT "ld" + #define PRINT_UINT_FMT "lu" + #else + #define PRINT_SZ_FMT "llu" + #define PRINT_INT_FMT "lld" + #define PRINT_UINT_FMT "llu" + #endif #else #define PRINT_SZ_FMT "u" #define PRINT_INT_FMT "d"