system/helpers: allow to build with c++11 compilers

Origin commit data
------------------
Commit: ae345d11d3
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2016-10-22 (Sat, 22 Oct 2016)
This commit is contained in:
Stefan Seyfried
2016-10-22 12:23:09 +02:00
committed by vanhofen
parent 241bcea831
commit b8b787b42b
2 changed files with 7 additions and 0 deletions

View File

@@ -1125,6 +1125,7 @@ std::vector<std::string> split(const std::string &s, char delim)
return vec; return vec;
} }
#if __cplusplus <= 201103L
std::string to_string(int i) std::string to_string(int i)
{ {
std::stringstream s; std::stringstream s;
@@ -1166,6 +1167,7 @@ std::string to_string(unsigned long long i)
s << i; s << i;
return s.str(); return s.str();
} }
#endif
/** /**
* C++ version 0.4 std::string style "itoa": * C++ version 0.4 std::string style "itoa":

View File

@@ -117,12 +117,17 @@ class CFileHelpers
uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true); uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true);
#if __cplusplus <= 201103L
std::string to_string(int); std::string to_string(int);
std::string to_string(unsigned int); std::string to_string(unsigned int);
std::string to_string(long); std::string to_string(long);
std::string to_string(unsigned long); std::string to_string(unsigned long);
std::string to_string(long long); std::string to_string(long long);
std::string to_string(unsigned long long); std::string to_string(unsigned long long);
#else
/* hack... */
#define to_string(x) std::to_string(x)
#endif
std::string itoa(int value, int base); std::string itoa(int value, int base);