1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Use the standard to_string() functions for C++11 (#4279)

If compiling according to a C++ version before C++11, then define
std::to_string ourselves.

Add a to_wstring version as well

As std::to_string() for floating point types uses %.6f as floating
point format converter, instead of %G, it needs special care.

To preserve ftos() behavior (which is expected to use the %G format
converter), it no longer uses to_string().
This commit is contained in:
Rogier-5 2016-08-11 19:22:40 +02:00 committed by est31
parent 35f47e5461
commit b11720af45
2 changed files with 42 additions and 7 deletions

View file

@ -820,7 +820,7 @@ void Client::initLocalMapSaving(const Address &address,
const std::string world_path = porting::path_user
+ DIR_DELIM + "worlds"
+ DIR_DELIM + "server_"
+ hostname + "_" + to_string(address.getPort());
+ hostname + "_" + std::to_string(address.getPort());
fs::CreateAllDirs(world_path);