From f92e8315cf9af3268545dad6c440614a13d06207 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 31 May 2009 16:15:12 -0500 Subject: [7918] Improve portability in work with uint64 string format specifiers and in code literals. Author: VladimirMangos * Replace platform seelction MaNGOS code for select format descriptor for uint64 by using ACE define. I64FMTD renamed to UI64FMTD for more clear name. * Add new define UI64LIT (base at ACE seelction) for build portables uint64 literals. Please always use UI64LIT(0x00001) instead less portable 0x00001LL --HG-- branch : trunk --- src/shared/Common.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/shared/Common.h') diff --git a/src/shared/Common.h b/src/shared/Common.h index 37ced4c8e11..735c57eedbe 100644 --- a/src/shared/Common.h +++ b/src/shared/Common.h @@ -103,6 +103,7 @@ #include "LockedQueue.h" #include "Threading.h" +#include #include #include #include @@ -130,8 +131,6 @@ #include #define I64FMT "%016I64X" -#define I64FMTD "%I64u" -#define SI64FMTD "%I64d" #define snprintf _snprintf #define atoll __atoi64 #define vsnprintf _vsnprintf @@ -143,10 +142,15 @@ #define stricmp strcasecmp #define strnicmp strncasecmp #define I64FMT "%016llX" -#define I64FMTD "%llu" -#define SI64FMTD "%lld" + #endif +#define UI64FMTD ACE_UINT64_FORMAT_SPECIFIER +#define UI64LIT(N) ACE_UINT64_LITERAL(N) + +#define SI64FMTD ACE_INT64_FORMAT_SPECIFIER +#define SI64LIT(N) ACE_INT64_LITERAL(N) + inline float finiteAlways(float f) { return finite(f) ? f : 0.0f; } #define atol(a) strtoul( a, NULL, 10) -- cgit v1.2.3