From 6544d736b9cacbdd8631b224e1bf4a06ed7a2877 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 23 Dec 2015 15:04:22 +0100 Subject: [PATCH] Changed: Use _LP64 macro instead of sizeof(long unsigned int) == 8 --- code/nel/include/nel/misc/string_common.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/nel/include/nel/misc/string_common.h b/code/nel/include/nel/misc/string_common.h index fac53be66..a5fb43eb1 100644 --- a/code/nel/include/nel/misc/string_common.h +++ b/code/nel/include/nel/misc/string_common.h @@ -195,9 +195,11 @@ inline std::string toString(const sint64 &val) { return toString("%"NL_I64"d", v // error fix for size_t? gcc 4.1.2 requested this type instead of size_t ... inline std::string toString(const long unsigned int &val) { - if (sizeof(long unsigned int) == 8) - return toString((uint64)val); +#ifdef _LP64 + return toString((uint64)val); +#else return toString((uint32)val); +#endif } # endif @@ -210,6 +212,7 @@ inline std::string toString(const size_t &val) { return toString("%"NL_I64"u", v inline std::string toString(const size_t &val) { return toString("%u", val); } #endif #endif + inline std::string toString(const float &val) { return toString("%f", val); } inline std::string toString(const double &val) { return toString("%lf", val); } inline std::string toString(const bool &val) { return toString("%u", val?1:0); }