From 3206f98716d47b86694f17b84e528e77fcaf2b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 2 May 2015 23:58:52 +0200 Subject: [PATCH] Work around missing std::to_string() on NaCl/Android/MinGW32. --- src/Magnum/DebugOutput.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Magnum/DebugOutput.cpp b/src/Magnum/DebugOutput.cpp index 26a80a5b0..37dc11bd9 100644 --- a/src/Magnum/DebugOutput.cpp +++ b/src/Magnum/DebugOutput.cpp @@ -32,6 +32,10 @@ #include "Magnum/Implementation/State.h" #include "Magnum/Implementation/DebugState.h" +#if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_ANDROID) || defined(__MINGW32__) +#include +#endif + namespace Magnum { namespace { @@ -99,7 +103,19 @@ void defaultCallback(const DebugOutput::Source source, const DebugOutput::Type t case DebugOutput::Type::Other: ; } - output << '(' + std::to_string(id) + "):" << string; + /** @todo Remove when this is fixed everywhere (also the include above) */ + #if defined(CORRADE_TARGET_NACL_NEWLIB) || defined(CORRADE_TARGET_ANDROID) || defined(__MINGW32__) + std::ostringstream converter; + converter << id; + #endif + + output << '(' + + #if !defined(CORRADE_TARGET_NACL_NEWLIB) && !defined(CORRADE_TARGET_ANDROID) && !defined(__MINGW32__) + std::to_string(id) + + #else + converter.str() + + #endif + "):" << string; } }