Browse Source

GCC 4.4 compatibility: ambiguous std::to_string() call.

It shouldn't be. What is ambiguous in conversion from `unsigned long
int` to `unsigned long long int`?
Vladimír Vondruš 13 years ago
parent
commit
6ec472038b
  1. 9
      src/Shader.cpp

9
src/Shader.cpp

@ -103,7 +103,14 @@ Shader& Shader::addSource(std::string source) {
if(!source.empty()) {
/* 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 " +
/* This shouldn't be ambiguous. But is. */
#ifndef CORRADE_GCC44_COMPATIBILITY
std::to_string((sources.size()+1)/2) +
#else
std::to_string(static_cast<unsigned long long int>(sources.size()+1)/2) +
#endif
'\n');
sources.push_back(std::move(source));
}

Loading…
Cancel
Save