From 7f51765c3611bcad7394e6a382167002ba16dac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 5 Jun 2013 00:10:34 +0200 Subject: [PATCH 1/2] Oh yeah, coding while drunk. F'ed up in c2a5919b5a7f78dbcf280a3dff2ec15dac7b12dc. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6186aeef..0a270208f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,7 +72,7 @@ if(CORRADE_TARGET_NACL OR CORRADE_TARGET_EMSCRIPTEN) # Newlib toolchain supports only static linking if(CORRADE_TARGET_NACL_NEWLIB) - set(BUILD_STATIC OFF) + set(BUILD_STATIC ON) endif() endif() From 0c31f5dbe4bede88ab7674831ff34eb0b1efc750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 5 Jun 2013 00:11:07 +0200 Subject: [PATCH 2/2] NaCl's newlib doesn't have std::to_string(). --- src/Shader.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Shader.cpp b/src/Shader.cpp index bdcb748fd..f13b1d383 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -27,6 +27,10 @@ #include #include +#ifdef CORRADE_TARGET_NACL_NEWLIB +#include +#endif + /* libgles-omap3-dev_4.03.00.02-r15.6 on BeagleBoard/Ångström linux 2011.3 doesn't have GLchar */ #ifdef MAGNUM_TARGET_GLES typedef char GLchar; @@ -101,9 +105,20 @@ Shader& Shader::operator=(Shader&& other) { Shader& Shader::addSource(std::string source) { if(!source.empty()) { + #ifdef CORRADE_TARGET_NACL_NEWLIB + std::ostringstream converter; + converter << (sources.size()+1)/2; + #endif + /* Fix line numbers, so line 41 of third added file is marked as 3(41). Source 0 is the #version string added in constructor. */ - sources.push_back("#line 1 " + std::to_string((sources.size()+1)/2) + '\n'); + sources.push_back("#line 1 " + + #ifndef CORRADE_TARGET_NACL_NEWLIB + std::to_string((sources.size()+1)/2) + + #else + converter.str() + + #endif + '\n'); sources.push_back(std::move(source)); }