Index: Makefile.in --- Makefile.in.orig 2014-12-24 12:37:23.000000000 +0100 +++ Makefile.in 2015-01-03 20:52:46.708442936 +0100 @@ -1029,7 +1029,7 @@ ### @brief libraries ################################################################################ LIBS = @LIBEV_LIBS@ @MATH_LIBS@ @OPENSSL_LIBS@ @ICU_LIBS@ @ZLIB_LIBS@ \ - @READLINE_LIBS@ $(am__append_2) + @READLINE_LIBS@ $(am__append_2) @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ Index: arangod/Aql/AqlValue.cpp --- arangod/Aql/AqlValue.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ arangod/Aql/AqlValue.cpp 2015-01-03 20:52:46.738480064 +0100 @@ -36,6 +36,15 @@ using Json = triagens::basics::Json; using JsonHelper = triagens::basics::JsonHelper; +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + //////////////////////////////////////////////////////////////////////////////// /// @brief a quick method to decide whether a value is true //////////////////////////////////////////////////////////////////////////////// @@ -496,7 +505,7 @@ id.push_back('/'); id.append(key); json(TRI_VOC_ATTRIBUTE_ID, Json(id)); - json(TRI_VOC_ATTRIBUTE_REV, Json(std::to_string(TRI_EXTRACT_MARKER_RID(_marker)))); + json(TRI_VOC_ATTRIBUTE_REV, Json(my_to_string(TRI_EXTRACT_MARKER_RID(_marker)))); json(TRI_VOC_ATTRIBUTE_KEY, Json(key)); if (TRI_IS_EDGE_MARKER(_marker)) { Index: arangod/Aql/AstNode.cpp --- arangod/Aql/AstNode.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ arangod/Aql/AstNode.cpp 2015-01-03 20:52:46.738480064 +0100 @@ -886,7 +886,7 @@ case VALUE_TYPE_STRING: try { // try converting string to number - double v = std::stod(value.value._string); + double v = std::strtod(value.value._string, NULL); return ast->createNodeValueDouble(v); } catch (...) { Index: arangod/Aql/ExecutionBlock.cpp --- arangod/Aql/ExecutionBlock.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ arangod/Aql/ExecutionBlock.cpp 2015-01-03 20:52:46.738480064 +0100 @@ -45,6 +45,15 @@ using JsonHelper = triagens::basics::JsonHelper; using StringBuffer = triagens::basics::StringBuffer; +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + // uncomment the following to get some debugging information #if 0 #define ENTER_BLOCK try { (void) 0; @@ -4872,7 +4881,7 @@ std::unique_ptr res; res.reset(sendRequest(rest::HttpRequest::HTTP_REQUEST_PUT, "/_api/aql/shutdown/", - string("{\"code\":" + std::to_string(errorCode) + "}"))); + string("{\"code\":" + my_to_string(errorCode) + "}"))); if (throwExceptionAfterBadSyncRequest(res.get(), true)) { // artificially ignore error in case query was not found during shutdown return TRI_ERROR_NO_ERROR; Index: arangod/Aql/ExecutionNode.cpp --- arangod/Aql/ExecutionNode.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ arangod/Aql/ExecutionNode.cpp 2015-01-03 20:52:46.748552014 +0100 @@ -39,6 +39,15 @@ const static bool Optional = true; +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + // ----------------------------------------------------------------------------- // --SECTION-- static initialization // ----------------------------------------------------------------------------- @@ -1955,7 +1964,7 @@ else { // use variable only. note that we cannot use the variable's name as it is not // necessarily unique in one query (yes, COLLECT, you are to blame!) - result.criteria.emplace_back(std::make_tuple(setter, std::to_string(variable->id), (*it).second)); + result.criteria.emplace_back(std::make_tuple(setter, my_to_string(variable->id), (*it).second)); } } Index: arangod/Aql/ExecutionPlan.cpp --- arangod/Aql/ExecutionPlan.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ arangod/Aql/ExecutionPlan.cpp 2015-01-03 20:52:46.748552014 +0100 @@ -44,6 +44,15 @@ using namespace triagens::basics; using JsonHelper = triagens::basics::JsonHelper; +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + // ----------------------------------------------------------------------------- // --SECTION-- constructors / destructors // ----------------------------------------------------------------------------- @@ -212,7 +221,7 @@ return (*it).second; } - std::string msg = std::string("node [") + std::to_string(id) + std::string("] wasn't found"); + std::string msg = std::string("node [") + my_to_string(id) + std::string("] wasn't found"); // node unknown THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, msg); } Index: arangod/Aql/Expression.cpp --- arangod/Aql/Expression.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ arangod/Aql/Expression.cpp 2015-01-04 10:38:29.628761019 +0100 @@ -44,6 +44,15 @@ using Json = triagens::basics::Json; using JsonHelper = triagens::basics::JsonHelper; +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + // ----------------------------------------------------------------------------- // --SECTION-- constructors / destructors // ----------------------------------------------------------------------------- @@ -392,7 +401,7 @@ try { // stoll() might throw an exception if the string is not a number - int64_t position = static_cast(std::stoll(value.c_str())); + int64_t position = static_cast(std::strtol(value.c_str(), NULL, 10)); auto j = result.extractListMember(trx, myCollection, position, true); result.destroy(); return AqlValue(new Json(TRI_UNKNOWN_MEM_ZONE, j.steal())); @@ -408,7 +417,7 @@ AqlValue indexResult = executeSimpleExpression(index, &myCollection2, trx, docColls, argv, startPos, vars, regs); if (indexResult.isNumber()) { - auto&& indexString = std::to_string(indexResult.toInt64()); + auto&& indexString = my_to_string(indexResult.toInt64()); auto j = result.extractArrayMember(trx, myCollection, indexString.c_str()); indexResult.destroy(); result.destroy(); Index: arangod/Aql/VariableGenerator.cpp --- arangod/Aql/VariableGenerator.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ arangod/Aql/VariableGenerator.cpp 2015-01-04 10:53:27.838281992 +0100 @@ -33,6 +33,15 @@ using namespace triagens::aql; using Json = triagens::basics::Json; +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + // ----------------------------------------------------------------------------- // --SECTION-- constructors / destructors // ----------------------------------------------------------------------------- @@ -202,7 +211,7 @@ std::string VariableGenerator::nextName () const { // note: if the naming scheme is adjusted, it may be necessary to adjust // Variable::isUserDefined, too! - return std::to_string(_id); // to_string: c++11 + return my_to_string(_id); // to_string: c++11 } //////////////////////////////////////////////////////////////////////////////// Index: arangosh/V8Client/ImportHelper.cpp --- arangosh/V8Client/ImportHelper.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ arangosh/V8Client/ImportHelper.cpp 2015-01-04 13:29:35.758315752 +0100 @@ -532,7 +532,7 @@ try { if (fieldLength > 8) { // long integer numbers might be problematic. check if we get out of range - std::stoll(std::string(field, fieldLength)); // this will fail if the number cannot be converted + std::strtol(std::string(field, fieldLength).c_str(), NULL, 10); // this will fail if the number cannot be converted } int64_t num = StringUtils::int64(field, fieldLength); Index: lib/Basics/JsonHelper.cpp --- lib/Basics/JsonHelper.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ lib/Basics/JsonHelper.cpp 2015-01-03 20:52:46.728591796 +0100 @@ -130,7 +130,7 @@ if (isString(k) && isString(v)) { std::string const key = std::string(k->_value._string.data, k->_value._string.length - 1); std::string const value = std::string(v->_value._string.data, v->_value._string.length - 1); - result.emplace(std::make_pair(key, value)); + result.insert(std::make_pair(key, value)); } } } Index: lib/Basics/json.cpp --- lib/Basics/json.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ lib/Basics/json.cpp 2015-01-03 20:52:46.728591796 +0100 @@ -1289,7 +1289,7 @@ case TRI_JSON_STRING_REFERENCE: try { // try converting string to number - double v = std::stod(json->_value._string.data); + double v = std::strtod(json->_value._string.data, NULL); return static_cast(v); } catch (...) { @@ -1331,7 +1331,7 @@ case TRI_JSON_STRING_REFERENCE: try { // try converting string to number - double v = std::stod(json->_value._string.data); + double v = std::strtod(json->_value._string.data, NULL); return v; } catch (...) { Index: lib/Basics/operating-system.h --- lib/Basics/operating-system.h.orig 2014-12-24 12:37:23.000000000 +0100 +++ lib/Basics/operating-system.h 2015-01-03 20:52:46.738480064 +0100 @@ -289,6 +289,7 @@ #define TRI_GCC_THREAD_LOCAL_STORAGE 1 +#define TRI_HAVE_SC_PHYS_PAGES 1 #define TRI_HAVE_LINUX_PROC 1 #define TRI_HAVE_LINUX_SOCKETS 1 #define TRI_HAVE_POSIX_SPIN 1 Index: lib/JsonParser/json-parser.cpp --- lib/JsonParser/json-parser.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ lib/JsonParser/json-parser.cpp 2015-01-03 20:52:46.718520614 +0100 @@ -38,6 +38,7 @@ #ifndef __FreeBSD__ int fileno(FILE *stream); #endif +#include #endif #define YY_NO_INPUT Index: lib/JsonParser/json-parser.ll --- lib/JsonParser/json-parser.ll.orig 2014-12-24 12:37:23.000000000 +0100 +++ lib/JsonParser/json-parser.ll 2015-01-03 20:52:46.718520614 +0100 @@ -38,6 +38,7 @@ #ifndef __FreeBSD__ int fileno(FILE *stream); #endif +#include #endif #define YY_NO_INPUT Index: lib/ProgramOptions/program-options.cpp --- lib/ProgramOptions/program-options.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ lib/ProgramOptions/program-options.cpp 2015-01-03 20:52:46.738480064 +0100 @@ -197,7 +197,7 @@ for (size_t i = 0; i < options->_items._length; ++i) { TRI_PO_item_t const* item = static_cast(TRI_AtVector(&options->_items, i)); - distances.emplace(TRI_Levenshtein(option, item->_desc->_name), item->_desc->_name); + distances.insert(std::make_pair(TRI_Levenshtein(option, item->_desc->_name), item->_desc->_name)); } if (! distances.empty()) { Index: lib/Rest/InitialiseRest.cpp --- lib/Rest/InitialiseRest.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ lib/Rest/InitialiseRest.cpp 2015-01-03 20:52:46.718520614 +0100 @@ -37,7 +37,6 @@ #include #ifndef OPENSSL_THREADS -#error missing thread support for openssl, please recomple OpenSSL with threads #endif #include "Basics/logging.h" Index: lib/SimpleHttpClient/SimpleHttpClient.cpp --- lib/SimpleHttpClient/SimpleHttpClient.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ lib/SimpleHttpClient/SimpleHttpClient.cpp 2015-01-03 20:52:46.728591796 +0100 @@ -685,7 +685,7 @@ uint32_t contentLength; try { - contentLength = static_cast(std::stol(line, nullptr, 16)); // C++11 + contentLength = static_cast(strtol(line.c_str(), NULL, 16)); // C++11 } catch (...) { setErrorMessage("found invalid content-length", true); Index: lib/Statistics/statistics.cpp --- lib/Statistics/statistics.cpp.orig 2014-12-24 12:37:23.000000000 +0100 +++ lib/Statistics/statistics.cpp 2015-01-03 20:52:46.728591796 +0100 @@ -391,7 +391,7 @@ #else -static uint64_t TRI_GetPhysicalMemory () { +static uint64_t GetPhysicalMemory () { PROCESS_MEMORY_COUNTERS pmc; memset(&result, 0, sizeof(result)); pmc.cb = sizeof(PROCESS_MEMORY_COUNTERS);