From b19917d66a13800838ea72a0303d5c59e402a473 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 12:23:09 +0200 Subject: [PATCH] system/helpers: allow to build with c++11 compilers Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3684680cb209ee32d2b7f9bfbd1c9ac2e04b18ec Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 2 ++ src/system/helpers.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 6a21421ff..a2f9d3414 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -1086,6 +1086,7 @@ std::vector split(const std::string &s, char delim) return vec; } +#if __cplusplus <= 201103L std::string to_string(int i) { std::stringstream s; @@ -1127,6 +1128,7 @@ std::string to_string(unsigned long long i) s << i; return s.str(); } +#endif /** * C++ version 0.4 std::string style "itoa": diff --git a/src/system/helpers.h b/src/system/helpers.h index 8c1961ffb..1e2c9e372 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -116,12 +116,17 @@ class CFileHelpers 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(unsigned int); std::string to_string(long); std::string to_string(unsigned long); std::string to_string(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);