Index: 3rdParty/V8-4.1.0.27/build/all.gyp --- 3rdParty/V8-4.1.0.27/build/all.gyp.orig 2015-08-25 19:56:45.000000000 +0200 +++ 3rdParty/V8-4.1.0.27/build/all.gyp 2015-08-27 13:18:24.745774578 +0200 @@ -8,10 +8,7 @@ 'target_name': 'All', 'type': 'none', 'dependencies': [ - '../samples/samples.gyp:*', - '../src/d8.gyp:d8', - '../test/cctest/cctest.gyp:*', - '../test/unittests/unittests.gyp:*', + '../src/d8.gyp:d8' ], 'conditions': [ ['component!="shared_library"', { Index: 3rdParty/V8-4.1.0.27/src/base/platform/platform-freebsd.cc --- 3rdParty/V8-4.1.0.27/src/base/platform/platform-freebsd.cc.orig 2015-08-25 19:56:45.000000000 +0200 +++ 3rdParty/V8-4.1.0.27/src/base/platform/platform-freebsd.cc 2015-08-27 13:18:24.745774578 +0200 @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include Index: 3rdParty/V8-4.1.0.27/src/base/platform/platform-posix.cc --- 3rdParty/V8-4.1.0.27/src/base/platform/platform-posix.cc.orig 2015-08-25 19:56:45.000000000 +0200 +++ 3rdParty/V8-4.1.0.27/src/base/platform/platform-posix.cc 2015-08-27 13:18:24.745774578 +0200 @@ -26,6 +26,9 @@ defined(__NetBSD__) || defined(__OpenBSD__) #include // NOLINT, for sysctl #endif +#if defined(__FreeBSD__) +#include +#endif #undef MAP_TYPE @@ -36,6 +39,7 @@ #include #include +#include #include "src/base/lazy-instance.h" #include "src/base/macros.h" Index: 3rdParty/V8-4.1.0.27/tools/gyp/v8.gyp --- 3rdParty/V8-4.1.0.27/tools/gyp/v8.gyp.orig 2015-08-25 19:56:45.000000000 +0200 +++ 3rdParty/V8-4.1.0.27/tools/gyp/v8.gyp 2015-08-27 13:18:24.745774578 +0200 @@ -341,6 +341,9 @@ '../..', ], 'sources': [ ### gcmole(all) ### + '<(SHARED_INTERMEDIATE_DIR)/libraries.cc', + '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc', + '../../src/snapshot-empty.cc', '../../src/accessors.cc', '../../src/accessors.h', '../../src/allocation.cc', Index: Installation/file-list-js.sh --- Installation/file-list-js.sh.orig 2015-08-25 19:56:45.000000000 +0200 +++ Installation/file-list-js.sh 2015-08-27 13:18:24.745774578 +0200 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e SRCDIR=$1 Index: Makefile.in --- Makefile.in.orig 2015-08-25 19:56:45.000000000 +0200 +++ Makefile.in 2015-08-27 13:18:24.757010434 +0200 @@ -958,7 +958,7 @@ @OPENSSL_LIBS@ \ @ICU_LIBS@ \ @ZLIB_LIBS@ \ - @READLINE_LIBS@ + @READLINE_LIBS@ @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ @@ -9596,7 +9596,7 @@ ################################################################################ ################################################################################ -@ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_TRUE@ cd @top_srcdir@/3rdParty/$(V8DIR) \ +@ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_TRUE@ cd @top_srcdir@/3rdParty/$(V8DIR) && \ @ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_TRUE@ export GYPFLAGS="-Darm_fpu=vfp -Darm_version=6 -Dstandalone_static_library=1" \ @ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_TRUE@ && $(MAKE) \ @ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_TRUE@ CC="$(CC)" \ @@ -9609,7 +9609,7 @@ @ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_TRUE@ LDFLAGS="-march=armv6" \ @ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_TRUE@ debug=on v8_optimized_debug=0 v8_enable_backtrace=on \ @ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_TRUE@ library=static strictaliasing=off snapshot=off werror=no hardfp=on @V8_TARGET@ -@ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_FALSE@ cd @top_srcdir@/3rdParty/$(V8DIR) \ +@ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_FALSE@ cd @top_srcdir@/3rdParty/$(V8DIR) && \ @ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_FALSE@ export GYPFLAGS="-Darm_fpu=vfp -Darm_version=6 -Dstandalone_static_library=1" \ @ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_FALSE@ && $(MAKE) \ @ENABLE_ARMV6_TRUE@@ENABLE_V8_DEBUG_FALSE@ CC="$(CC)" \ @@ -9625,7 +9625,7 @@ ################################################################################ ################################################################################ -@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_TRUE@ cd @top_srcdir@/3rdParty/$(V8DIR) \ +@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_TRUE@ cd @top_srcdir@/3rdParty/$(V8DIR) && \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_TRUE@ export GYPFLAGS="-Darm_fpu=vfp -Darm_version=6 -Dstandalone_static_library=1" \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_TRUE@ && $(MAKE) \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_TRUE@ CC="$(CC)" \ @@ -9638,7 +9638,7 @@ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_TRUE@ LDFLAGS="-march=armv7" \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_TRUE@ debug=on v8_optimized_debug=0 v8_enable_backtrace=on \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_TRUE@ library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@ -@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_FALSE@ cd @top_srcdir@/3rdParty/$(V8DIR) \ +@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_FALSE@ cd @top_srcdir@/3rdParty/$(V8DIR) && \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_FALSE@ export GYPFLAGS=" -Darm_version=7 -Dstandalone_static_library=1" \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_FALSE@ && $(MAKE) \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_TRUE@@ENABLE_V8_DEBUG_FALSE@ CC="$(CC)" \ @@ -9654,7 +9654,7 @@ ################################################################################ ################################################################################ -@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_TRUE@ cd @top_srcdir@/3rdParty/$(V8DIR) \ +@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_TRUE@ cd @top_srcdir@/3rdParty/$(V8DIR) && \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_TRUE@ export GYPFLAGS="-Dstandalone_static_library=1" \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_TRUE@ && $(MAKE) \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_TRUE@ CC="$(CC)" \ @@ -9671,7 +9671,7 @@ ################################################################################ ################################################################################ -@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_FALSE@ cd @top_srcdir@/3rdParty/$(V8DIR) \ +@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_FALSE@ cd @top_srcdir@/3rdParty/$(V8DIR) && \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_FALSE@ export GYPFLAGS="-Dstandalone_static_library=1" \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_FALSE@ && $(MAKE) \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_TRUE@@ENABLE_V8_DEBUG_FALSE@ CC="$(CC)" \ @@ -9687,7 +9687,7 @@ ################################################################################ ################################################################################ -@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_TRUE@ cd @top_srcdir@/3rdParty/$(V8DIR) \ +@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_TRUE@ cd @top_srcdir@/3rdParty/$(V8DIR) && \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_TRUE@ export GYPFLAGS="-Dstandalone_static_library=1" \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_TRUE@ && $(MAKE) \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_TRUE@ CC="$(CC)" \ @@ -9699,7 +9699,7 @@ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_TRUE@ CXXFLAGS="-O0 -ggdb $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS)" \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_TRUE@ debug=on v8_optimized_debug=0 v8_enable_backtrace=on \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_TRUE@ library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@ -@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_FALSE@ cd @top_srcdir@/3rdParty/$(V8DIR) \ +@ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_FALSE@ cd @top_srcdir@/3rdParty/$(V8DIR) && \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_FALSE@ export GYPFLAGS="-Dstandalone_static_library=1" \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_FALSE@ && $(MAKE) \ @ENABLE_ARMV6_FALSE@@ENABLE_ARMV7_FALSE@@ENABLE_DARWIN_FALSE@@ENABLE_V8_DEBUG_FALSE@ CC="$(CC)" \ Index: arangod/Aql/AqlValue.cpp --- arangod/Aql/AqlValue.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/AqlValue.cpp 2015-08-27 13:18:24.757010434 +0200 @@ -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 //////////////////////////////////////////////////////////////////////////////// @@ -645,7 +654,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)) { @@ -740,7 +749,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 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/AstNode.cpp 2015-08-27 14:42:07.625669579 +0200 @@ -973,7 +973,7 @@ case VALUE_TYPE_STRING: try { // try converting string to number - double v = std::stod(std::string(value.value._string, value.length)); + double v = std::strtod(std::string(value.value._string, value.length).c_str(), NULL); return ast->createNodeValueDouble(v); } catch (...) { Index: arangod/Aql/Collection.cpp --- arangod/Aql/Collection.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/Collection.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -38,6 +38,15 @@ #include "VocBase/transaction.h" #include "VocBase/vocbase.h" +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace triagens::aql; // ----------------------------------------------------------------------------- @@ -149,7 +158,7 @@ std::string id; if (triagens::arango::ServerState::instance()->isDBServer() && documentCollection()->_info._planId > 0) { - id = std::to_string(documentCollection()->_info._planId); + id = my_to_string(documentCollection()->_info._planId); } else { id = name; Index: arangod/Aql/ExecutionBlock.cpp --- arangod/Aql/ExecutionBlock.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/ExecutionBlock.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -50,6 +50,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; @@ -4541,7 +4550,7 @@ auto planId = _collection->documentCollection()->_info._planId; auto vocbase = static_cast(_exeNode)->_vocbase; - return triagens::arango::shardKeysChanged(vocbase->_name, std::to_string(planId), oldJson, newJson, isPatch); + return triagens::arango::shardKeysChanged(vocbase->_name, my_to_string(planId), oldJson, newJson, isPatch); } //////////////////////////////////////////////////////////////////////////////// @@ -6672,7 +6681,7 @@ std::string DistributeBlock::createKey () const { ClusterInfo* ci = ClusterInfo::instance(); uint64_t uid = ci->uniqid(); - return std::to_string(uid); + return my_to_string(uid); } // ----------------------------------------------------------------------------- @@ -6913,7 +6922,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 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/ExecutionNode.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -38,6 +38,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 // ----------------------------------------------------------------------------- @@ -2287,7 +2296,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 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/ExecutionPlan.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -45,6 +45,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 // ----------------------------------------------------------------------------- @@ -215,7 +224,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/Executor.cpp --- arangod/Aql/Executor.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/Executor.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -37,6 +37,15 @@ #include "V8/v8-conv.h" #include "V8/v8-globals.h" +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace triagens::aql; // ----------------------------------------------------------------------------- @@ -307,7 +316,7 @@ v8::Handle constantValues = v8::Object::New(isolate); for (auto& it : _constantRegisters) { std::string name = "r"; - name.append(std::to_string(it.second)); + name.append(my_to_string(it.second)); constantValues->ForceSet(TRI_V8_STD_STRING(name), toV8(isolate, it.first)); } Index: arangod/Aql/Expression.cpp --- arangod/Aql/Expression.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/Expression.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -46,6 +46,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-- public static members // ----------------------------------------------------------------------------- @@ -511,7 +520,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.extractArrayMember(trx, myCollection, position, true); result.destroy(); return AqlValue(new Json(TRI_UNKNOWN_MEM_ZONE, j.steal())); @@ -531,7 +540,7 @@ AqlValue indexResult = executeSimpleExpression(index, &myCollection2, trx, argv, startPos, vars, regs, false); if (indexResult.isNumber()) { - auto&& indexString = std::to_string(indexResult.toInt64()); + auto&& indexString = my_to_string(indexResult.toInt64()); auto j = result.extractObjectMember(trx, myCollection, indexString.c_str(), true, _buffer); indexResult.destroy(); result.destroy(); Index: arangod/Aql/Functions.cpp --- arangod/Aql/Functions.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/Functions.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -37,6 +37,15 @@ #include "Basics/Utf8Helper.h" #include "Rest/SslInterface.h" +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace triagens::aql; using Json = triagens::basics::Json; Index: arangod/Aql/VariableGenerator.cpp --- arangod/Aql/VariableGenerator.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Aql/VariableGenerator.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -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 // ----------------------------------------------------------------------------- @@ -204,7 +213,7 @@ std::string VariableGenerator::nextName () { // note: if the naming scheme is adjusted, it may be necessary to adjust // Variable::isUserDefined, too! - return std::to_string(nextId()); // to_string: c++11 + return my_to_string(nextId()); // to_string: c++11 } //////////////////////////////////////////////////////////////////////////////// Index: arangod/Indexes/Index.cpp --- arangod/Indexes/Index.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Indexes/Index.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -33,6 +33,15 @@ #include "VocBase/document-collection.h" #include "VocBase/server.h" +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace triagens::arango; // ----------------------------------------------------------------------------- @@ -333,7 +342,7 @@ triagens::basics::Json Index::toJson (TRI_memory_zone_t* zone) const { triagens::basics::Json json(zone, triagens::basics::Json::Object, 4); - json("id", triagens::basics::Json(zone, std::to_string(_iid))) + json("id", triagens::basics::Json(zone, my_to_string(_iid))) ("type", triagens::basics::Json(zone, typeName())); if (dumpFields()) { Index: arangod/RestHandler/RestReplicationHandler.cpp --- arangod/RestHandler/RestReplicationHandler.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/RestHandler/RestReplicationHandler.cpp 2015-08-27 17:34:31.665733329 +0200 @@ -49,6 +49,15 @@ #include "VocBase/update-policy.h" #include "Wal/LogfileManager.h" +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace std; using namespace triagens::basics; using namespace triagens::rest; @@ -594,7 +603,7 @@ TRI_Insert3ObjectJson(TRI_UNKNOWN_MEM_ZONE, json, "firstTick", TRI_CreateNullJson(TRI_UNKNOWN_MEM_ZONE)); } else { - auto tickString = std::to_string(tick); + auto tickString = my_to_string(tick); TRI_Insert3ObjectJson(TRI_UNKNOWN_MEM_ZONE, json, "firstTick", TRI_CreateStringCopyJson(TRI_UNKNOWN_MEM_ZONE, tickString.c_str(), tickString.size())); } Index: arangod/RestServer/ArangoServer.cpp --- arangod/RestServer/ArangoServer.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/RestServer/ArangoServer.cpp 2015-08-27 17:36:56.645751251 +0200 @@ -84,6 +84,15 @@ #include "VocBase/server.h" #include "Wal/LogfileManager.h" +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace std; using namespace triagens::basics; using namespace triagens::rest; @@ -107,7 +116,7 @@ string sep = "["; for (auto e : v) { - result += sep + to_string(e); + result += sep + my_to_string(e); sep = ","; } @@ -983,7 +992,7 @@ _additionalThreads[i] = n; _applicationDispatcher->buildNamedQueue( - to_string(i + 1), n, (int) _dispatcherQueueSize); + my_to_string(i + 1), n, (int) _dispatcherQueueSize); } } @@ -1141,13 +1150,13 @@ if (0 < ns && 0 < nd) { LOG_INFO("scheduler cores: %s, dispatcher cores: %s", - to_string(ps).c_str(), to_string(pd).c_str()); + my_to_string(ps).c_str(), my_to_string(pd).c_str()); } else if (0 < ns) { - LOG_INFO("scheduler cores: %s", to_string(ps).c_str()); + LOG_INFO("scheduler cores: %s", my_to_string(ps).c_str()); } else if (0 < nd) { - LOG_INFO("dispatcher cores: %s", to_string(pd).c_str()); + LOG_INFO("dispatcher cores: %s", my_to_string(pd).c_str()); } } else { Index: arangod/Utils/Cursor.cpp --- arangod/Utils/Cursor.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangod/Utils/Cursor.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -35,6 +35,15 @@ #include "VocBase/vocbase.h" #include "VocBase/voc-shaper.h" +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace triagens::arango; // ----------------------------------------------------------------------------- @@ -318,7 +327,7 @@ id.append(key); json(TRI_VOC_ATTRIBUTE_ID, triagens::basics::Json(id)); - json(TRI_VOC_ATTRIBUTE_REV, triagens::basics::Json(std::to_string(TRI_EXTRACT_MARKER_RID(marker)))); + json(TRI_VOC_ATTRIBUTE_REV, triagens::basics::Json(my_to_string(TRI_EXTRACT_MARKER_RID(marker)))); json(TRI_VOC_ATTRIBUTE_KEY, triagens::basics::Json(key)); if (TRI_IS_EDGE_MARKER(marker)) { Index: arangosh/V8Client/ImportHelper.cpp --- arangosh/V8Client/ImportHelper.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ arangosh/V8Client/ImportHelper.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -535,7 +535,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 2015-08-25 19:56:45.000000000 +0200 +++ lib/Basics/JsonHelper.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -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/files.cpp --- lib/Basics/files.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/Basics/files.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -54,6 +54,15 @@ #include #endif +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace std; // ----------------------------------------------------------------------------- @@ -497,7 +506,7 @@ #endif if (res != 0) { - err = "error setting desired mode " + std::to_string(mode) + " for file " + path + ": " + strerror(errno); + err = "error setting desired mode " + my_to_string(mode) + " for file " + path + ": " + strerror(errno); return errno; } Index: lib/Basics/json.cpp --- lib/Basics/json.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/Basics/json.cpp 2015-08-27 13:18:24.765752955 +0200 @@ -1128,7 +1128,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 (...) { @@ -1171,7 +1171,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 2015-08-25 19:56:45.000000000 +0200 +++ lib/Basics/operating-system.h 2015-08-27 13:18:24.775712252 +0200 @@ -301,6 +301,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/Basics/tri-zip.cpp --- lib/Basics/tri-zip.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/Basics/tri-zip.cpp 2015-08-27 13:18:24.775712252 +0200 @@ -39,6 +39,15 @@ #include "Zip/iowin32.h" #endif +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + // ----------------------------------------------------------------------------- // --SECTION-- private functions // ----------------------------------------------------------------------------- @@ -67,7 +76,7 @@ filenameInZip[0] = '\0'; err = unzGetCurrentFileInfo64(uf, &fileInfo, filenameInZip, sizeof(filenameInZip), NULL, 0, NULL, 0); if(err != UNZ_OK) { - errorMessage = std::string("Failed to get file info for ") + filenameInZip + ": " + std::to_string(err); + errorMessage = std::string("Failed to get file info for ") + filenameInZip + ": " + my_to_string(err); return TRI_ERROR_INTERNAL; } @@ -124,7 +133,7 @@ err = unzOpenCurrentFilePassword(uf, password); if (err != UNZ_OK) { - errorMessage = "failed to authenticate the password in the zip: " + std::to_string(err); + errorMessage = "failed to authenticate the password in the zip: " + my_to_string(err); return TRI_ERROR_INTERNAL; } @@ -237,7 +246,7 @@ err = unzGetGlobalInfo64(uf, &gi); if(err!= UNZ_OK) { - errorMessage = "Failed to get info: " + std::to_string(err); + errorMessage = "Failed to get info: " + my_to_string(err); return TRI_ERROR_INTERNAL; } @@ -254,7 +263,7 @@ break; } else if (err != UNZ_OK) { - errorMessage = "Failed to jump to next file: " + std::to_string(err); + errorMessage = "Failed to jump to next file: " + my_to_string(err); res = TRI_ERROR_INTERNAL; break; } Index: lib/HttpServer/HttpHandler.cpp --- lib/HttpServer/HttpHandler.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/HttpServer/HttpHandler.cpp 2015-08-27 14:39:29.485714780 +0200 @@ -35,6 +35,15 @@ #include "Dispatcher/Dispatcher.h" #include "Rest/HttpRequest.h" +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace triagens::basics; using namespace triagens::rest; using namespace std; @@ -154,7 +163,7 @@ if (found) { uint32_t qnr = StringUtils::uint32(queue); - _queueName = to_string(qnr); + _queueName = my_to_string(qnr); } return new HttpServerJob(server, this, isDetached); Index: lib/JsonParser/json-parser.cpp --- lib/JsonParser/json-parser.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/JsonParser/json-parser.cpp 2015-08-27 13:18:24.775712252 +0200 @@ -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 2015-08-25 19:56:45.000000000 +0200 +++ lib/JsonParser/json-parser.ll 2015-08-27 13:18:24.775712252 +0200 @@ -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 2015-08-25 19:56:45.000000000 +0200 +++ lib/ProgramOptions/program-options.cpp 2015-08-27 13:18:24.775712252 +0200 @@ -199,7 +199,7 @@ for (size_t i = 0; i < TRI_LengthVector(&options->_items); ++i) { auto 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 2015-08-25 19:56:45.000000000 +0200 +++ lib/Rest/InitialiseRest.cpp 2015-08-27 13:18:24.775712252 +0200 @@ -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/ClientConnection.cpp --- lib/SimpleHttpClient/ClientConnection.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/SimpleHttpClient/ClientConnection.cpp 2015-08-27 13:18:24.775712252 +0200 @@ -58,6 +58,15 @@ #define STR_ERROR() strerror(errno) #endif +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace triagens::basics; using namespace triagens::httpclient; using namespace triagens::rest; @@ -229,7 +238,7 @@ #endif char const* pErr = STR_ERROR(); - _errorDetails = std::string("during prepare: ") + std::to_string(errno) + std::string(" - ") + pErr; + _errorDetails = std::string("during prepare: ") + my_to_string(errno) + std::string(" - ") + pErr; TRI_set_errno(errno); } Index: lib/SimpleHttpClient/SimpleHttpClient.cpp --- lib/SimpleHttpClient/SimpleHttpClient.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/SimpleHttpClient/SimpleHttpClient.cpp 2015-08-27 13:18:24.775712252 +0200 @@ -702,7 +702,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/SimpleHttpClient/SslClientConnection.cpp --- lib/SimpleHttpClient/SslClientConnection.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/SimpleHttpClient/SslClientConnection.cpp 2015-08-27 13:18:24.775712252 +0200 @@ -65,6 +65,14 @@ #define STR_ERROR() strerror(errno) #endif +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} using namespace triagens::basics; using namespace triagens::httpclient; @@ -202,7 +210,7 @@ } else if (errorDetail == SSL_ERROR_SYSCALL) { char const* pErr = STR_ERROR(); - _errorDetails = std::string("SSL: during SSL_connect: ") + std::to_string(errno) + std::string(" - ") + pErr; + _errorDetails = std::string("SSL: during SSL_connect: ") + my_to_string(errno) + std::string(" - ") + pErr; } else { errorDetail = ERR_get_error(); /* Gets the earliest error code from the @@ -349,7 +357,7 @@ case SSL_ERROR_SYSCALL: { char const* pErr = STR_ERROR(); _errorDetails = std::string("SSL: while writing: SYSCALL returned errno = ") + - std::to_string(errno) + std::string(" - ") + pErr; + my_to_string(errno) + std::string(" - ") + pErr; break; } @@ -365,7 +373,7 @@ default: /* a true error */ - _errorDetails = std::string("SSL: while writing: error ") + std::to_string(err); + _errorDetails = std::string("SSL: while writing: error ") + my_to_string(err); } return false; @@ -427,7 +435,7 @@ int errorDetail = ERR_get_error(); char errorBuffer[256]; ERR_error_string_n(errorDetail, errorBuffer, sizeof(errorBuffer)); - _errorDetails = std::string("SSL: while reading: error '") + std::to_string(errno) + + _errorDetails = std::string("SSL: while reading: error '") + my_to_string(errno) + std::string("' - ") + errorBuffer + std::string("' - ") + pErr; /* unexpected */ Index: lib/Statistics/statistics.cpp --- lib/Statistics/statistics.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/Statistics/statistics.cpp 2015-08-27 13:18:24.775712252 +0200 @@ -365,7 +365,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); Index: lib/V8/v8-utils.cpp --- lib/V8/v8-utils.cpp.orig 2015-08-25 19:56:45.000000000 +0200 +++ lib/V8/v8-utils.cpp 2015-08-27 13:18:24.775712252 +0200 @@ -64,6 +64,15 @@ #include "3rdParty/valgrind/valgrind.h" +#include +#include + +template std::string my_to_string(const T& n) { + std::ostringstream stm; + stm << n; + return stm.str(); +} + using namespace std; using namespace triagens::arango; using namespace triagens::basics; @@ -2175,7 +2184,7 @@ "] to [" + destination + " ] : " + - std::to_string(errorNo) + + my_to_string(errorNo) + ": " + systemErrorStr; TRI_V8_THROW_EXCEPTION_MESSAGE(res, errMsg); @@ -2233,7 +2242,7 @@ "] to [" + destination + " ] : " + - std::to_string(errorNo) + + my_to_string(errorNo) + " - Unable to create target directory: " + systemErrorStr; TRI_V8_THROW_EXCEPTION_MESSAGE(res, errMsg); @@ -2245,7 +2254,7 @@ "] to [" + destination + " ] : " + - std::to_string(errorNo) + + my_to_string(errorNo) + ": " + systemErrorStr; TRI_V8_THROW_EXCEPTION_MESSAGE(TRI_ERROR_BAD_PARAMETER, errMsg);