Changed: Use _LP64 macro instead of sizeof(long unsigned int) == 8

This commit is contained in:
kervala 2015-12-23 15:04:22 +01:00
parent cdca1e324e
commit 6544d736b9

View file

@ -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); }