From 0a2776615f31191695170c54f248e08ad38c2666 Mon Sep 17 00:00:00 2001 From: Thiago Ize Date: Wed, 10 Dec 2025 14:24:48 -0600 Subject: [PATCH] do proper platform independent int64_t printf. Fixes macos build --- cuBQL/math/common.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/cuBQL/math/common.h b/cuBQL/math/common.h index 0b462a6..7b51b7f 100644 --- a/cuBQL/math/common.h +++ b/cuBQL/math/common.h @@ -9,6 +9,7 @@ #include // using cmath causes issues under Windows #include +#include #include #include #include @@ -396,17 +397,10 @@ namespace cuBQL { { printf("%f",f); return o; } inline __cubql_both dbgout operator<<(dbgout o, double f) { printf("%lf",f); return o; } -#ifdef _WIN32 inline __cubql_both dbgout operator<<(dbgout o, uint64_t i) - { printf("%llu",(unsigned long long)i); return o; } + { printf("%" PRIu64, i); return o; } inline __cubql_both dbgout operator<<(dbgout o, int64_t i) - { printf("%lli",(long long)i); return o; } -#else - inline __cubql_both dbgout operator<<(dbgout o, uint64_t i) - { printf("%lu",i); return o; } - inline __cubql_both dbgout operator<<(dbgout o, int64_t i) - { printf("%li",i); return o; } -#endif + { printf("%" PRId64, i); return o; } template inline __cubql_both dbgout operator<<(dbgout o, T *ptr) { printf("%p",ptr); return o; }