|
|
|
|
Index: 3rdParty/V8/CMakeLists.txt
|
|
|
|
|
--- 3rdParty/V8/CMakeLists.txt.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/V8/CMakeLists.txt 2017-02-02 23:22:45.176464000 +0100
|
|
|
|
|
@@ -209,7 +209,7 @@
|
|
|
|
|
list(APPEND V8_GYP_ARGS --format ninja)
|
|
|
|
|
list(APPEND V8_GYP_ARGS -S.${V8_TARGET_ARCH})
|
|
|
|
|
|
|
|
|
|
- if (LINUX)
|
|
|
|
|
+ if (LINUX OR FREEBSD)
|
|
|
|
|
set(V8_LIBRARY_DIR "${V8_LIBRARY_DIR}/obj.target/tools/gyp")
|
|
|
|
|
set(ICU_LIBRARY_DIR "${ICU_LIBRARY_DIR}/obj.target/third_party/icu")
|
|
|
|
|
elseif (SOLARIS)
|
|
|
|
|
@@ -255,7 +255,7 @@
|
|
|
|
|
"${PROJECT_NAME}: Libraries"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
- list(APPEND LINK_DIRECTORIES "${NINJA_BUILD_DIR}/obj/third_party/icu")
|
|
|
|
|
+ list(INSERT LINK_DIRECTORIES 0 "${NINJA_BUILD_DIR}/obj/third_party/icu")
|
|
|
|
|
|
|
|
|
|
set(ICU_LIBS
|
|
|
|
|
"icui18n;icuuc;icudata"
|
|
|
|
|
@@ -478,7 +478,7 @@
|
|
|
|
|
list(APPEND V8_GYP_ARGS --format make)
|
|
|
|
|
list(APPEND V8_GYP_ARGS -S.${V8_TARGET_ARCH})
|
|
|
|
|
|
|
|
|
|
- if (LINUX)
|
|
|
|
|
+ if (LINUX OR FREEBSD)
|
|
|
|
|
set(V8_LIBRARY_DIR "${V8_LIBRARY_DIR}/obj.target/tools/gyp")
|
|
|
|
|
set(ICU_LIBRARY_DIR "${ICU_LIBRARY_DIR}/obj.target/third_party/icu")
|
|
|
|
|
elseif (SOLARIS)
|
|
|
|
|
@@ -553,7 +553,7 @@
|
|
|
|
|
"${PROJECT_NAME}: Libraries"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
- list(APPEND LINK_DIRECTORIES "${ICU_LIBRARY_DIR}")
|
|
|
|
|
+ list(INSERT LINK_DIRECTORIES 0 "${ICU_LIBRARY_DIR}")
|
|
|
|
|
|
|
|
|
|
set(ICU_LIBS
|
|
|
|
|
"icui18n;icuuc;icudata"
|
|
|
|
|
Index: 3rdParty/V8/V8-5.0.71.39/build/all.gyp
|
|
|
|
|
--- 3rdParty/V8/V8-5.0.71.39/build/all.gyp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/V8/V8-5.0.71.39/build/all.gyp 2017-02-02 23:22:45.176677000 +0100
|
|
|
|
|
@@ -8,11 +8,7 @@
|
|
|
|
|
'target_name': 'All',
|
|
|
|
|
'type': 'none',
|
|
|
|
|
'dependencies': [
|
|
|
|
|
- '../samples/samples.gyp:*',
|
|
|
|
|
- '../src/d8.gyp:d8',
|
|
|
|
|
- '../test/cctest/cctest.gyp:*',
|
|
|
|
|
- '../test/fuzzer/fuzzer.gyp:*',
|
|
|
|
|
- '../test/unittests/unittests.gyp:*',
|
|
|
|
|
+ '../src/d8.gyp:d8'
|
|
|
|
|
],
|
|
|
|
|
'conditions': [
|
|
|
|
|
['component!="shared_library"', {
|
|
|
|
|
Index: 3rdParty/V8/V8-5.0.71.39/src/base/platform/platform-freebsd.cc
|
|
|
|
|
--- 3rdParty/V8/V8-5.0.71.39/src/base/platform/platform-freebsd.cc.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/V8/V8-5.0.71.39/src/base/platform/platform-freebsd.cc 2017-02-02 23:22:45.176904000 +0100
|
|
|
|
|
@@ -8,6 +8,7 @@
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
#include <semaphore.h>
|
|
|
|
|
#include <signal.h>
|
|
|
|
|
+#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <sys/resource.h>
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
|
Index: 3rdParty/V8/V8-5.0.71.39/src/base/platform/platform-posix.cc
|
|
|
|
|
--- 3rdParty/V8/V8-5.0.71.39/src/base/platform/platform-posix.cc.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/V8/V8-5.0.71.39/src/base/platform/platform-posix.cc 2017-02-02 23:22:45.177179000 +0100
|
|
|
|
|
@@ -26,6 +26,9 @@
|
|
|
|
|
defined(__NetBSD__) || defined(__OpenBSD__)
|
|
|
|
|
#include <sys/sysctl.h> // NOLINT, for sysctl
|
|
|
|
|
#endif
|
|
|
|
|
+#if defined(__FreeBSD__)
|
|
|
|
|
+#include <sys/thr.h>
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
#undef MAP_TYPE
|
|
|
|
|
|
|
|
|
|
@@ -36,6 +39,7 @@
|
|
|
|
|
|
|
|
|
|
#include <cmath>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
+#include <cstdio>
|
|
|
|
|
|
|
|
|
|
#include "src/base/lazy-instance.h"
|
|
|
|
|
#include "src/base/macros.h"
|
|
|
|
|
Index: 3rdParty/V8/V8-5.0.71.39/tools/gyp/v8.gyp
|
|
|
|
|
--- 3rdParty/V8/V8-5.0.71.39/tools/gyp/v8.gyp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/V8/V8-5.0.71.39/tools/gyp/v8.gyp 2017-02-02 23:22:45.177676000 +0100
|
|
|
|
|
@@ -438,6 +438,9 @@
|
|
|
|
|
'V8_IMMINENT_DEPRECATION_WARNINGS',
|
|
|
|
|
],
|
|
|
|
|
'sources': [ ### gcmole(all) ###
|
|
|
|
|
+ '<(SHARED_INTERMEDIATE_DIR)/libraries.cc',
|
|
|
|
|
+ '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries.cc',
|
|
|
|
|
+ '../../src/snapshot/snapshot-empty.cc',
|
|
|
|
|
'../../include/v8-debug.h',
|
|
|
|
|
'../../include/v8-experimental.h',
|
|
|
|
|
'../../include/v8-platform.h',
|
|
|
|
|
Index: 3rdParty/rocksdb/rocksdb/CMakeLists.txt
|
|
|
|
|
--- 3rdParty/rocksdb/rocksdb/CMakeLists.txt.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/rocksdb/rocksdb/CMakeLists.txt 2017-02-02 23:22:45.177964000 +0100
|
|
|
|
|
@@ -189,11 +189,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# -DSNAPPY -DZLIB
|
|
|
|
|
- if (SOLARIS OR DARWIN)
|
|
|
|
|
set(ROCKSDB_MALLOC_USABLE_SIZE "")
|
|
|
|
|
- else()
|
|
|
|
|
- set(ROCKSDB_MALLOC_USABLE_SIZE "-DROCKSDB_MALLOC_USABLE_SIZE")
|
|
|
|
|
- endif()
|
|
|
|
|
set(BASE_FLAGS "${BASE_FLAGS} -W -Wextra -Wall -Wsign-compare -Wshadow -Wno-unused-parameter -fno-omit-frame-pointer ${OPT_momit_leaf_frame_pointer} -fno-builtin-memcmp -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers ${ROCKSDB_MALLOC_USABLE_SIZE} -isystem -fPIC -D${OS_DEFINE} ${POSIX_FLAG}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Index: 3rdParty/rocksdb/rocksdb/Makefile
|
|
|
|
|
--- 3rdParty/rocksdb/rocksdb/Makefile.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/rocksdb/rocksdb/Makefile 2017-02-02 23:22:45.178323000 +0100
|
|
|
|
|
@@ -138,13 +138,7 @@
|
|
|
|
|
include make_config.mk
|
|
|
|
|
CLEAN_FILES += make_config.mk
|
|
|
|
|
|
|
|
|
|
-ifneq ($(PLATFORM), IOS)
|
|
|
|
|
-CFLAGS += -g
|
|
|
|
|
-CXXFLAGS += -g
|
|
|
|
|
-else
|
|
|
|
|
-# no debug info for IOS, that will make our library big
|
|
|
|
|
OPT += -DNDEBUG
|
|
|
|
|
-endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM), OS_SOLARIS)
|
|
|
|
|
PLATFORM_CXXFLAGS += -D _GLIBCXX_USE_C99
|
|
|
|
|
@@ -458,7 +452,7 @@
|
|
|
|
|
analyze tools
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-all: $(LIBRARY) $(BENCHMARKS) tools $(TESTS)
|
|
|
|
|
+all: $(LIBRARY)
|
|
|
|
|
|
|
|
|
|
static_lib: $(LIBRARY)
|
|
|
|
|
|
|
|
|
|
Index: 3rdParty/rocksdb/rocksdb/port/port_posix.h
|
|
|
|
|
--- 3rdParty/rocksdb/rocksdb/port/port_posix.h.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/rocksdb/rocksdb/port/port_posix.h 2017-02-02 23:22:45.178525000 +0100
|
|
|
|
|
@@ -27,7 +27,7 @@
|
|
|
|
|
#define PLATFORM_IS_LITTLE_ENDIAN \
|
|
|
|
|
(__DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN)
|
|
|
|
|
#endif
|
|
|
|
|
-#elif defined(OS_SOLARIS)
|
|
|
|
|
+#elif defined(OS_SOLARIS) || defined(__sun)
|
|
|
|
|
#include <sys/isa_defs.h>
|
|
|
|
|
#ifdef _LITTLE_ENDIAN
|
|
|
|
|
#define PLATFORM_IS_LITTLE_ENDIAN true
|
|
|
|
|
@@ -35,7 +35,7 @@
|
|
|
|
|
#define PLATFORM_IS_LITTLE_ENDIAN false
|
|
|
|
|
#endif
|
|
|
|
|
#elif defined(OS_FREEBSD) || defined(OS_OPENBSD) || defined(OS_NETBSD) || \
|
|
|
|
|
- defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID)
|
|
|
|
|
+ defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID) || defined(__FreeBSD__)
|
|
|
|
|
#include <sys/endian.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN)
|
|
|
|
|
Index: 3rdParty/rocksdb/rocksdb/tools/ldb_cmd.cc
|
|
|
|
|
--- 3rdParty/rocksdb/rocksdb/tools/ldb_cmd.cc.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/rocksdb/rocksdb/tools/ldb_cmd.cc 2017-02-02 23:22:45.179024000 +0100
|
|
|
|
|
@@ -213,7 +213,7 @@
|
|
|
|
|
map<string, string>::const_iterator itr = option_map_.find(option);
|
|
|
|
|
if (itr != option_map_.end()) {
|
|
|
|
|
try {
|
|
|
|
|
-#if defined(CYGWIN)
|
|
|
|
|
+#if 1
|
|
|
|
|
value = strtol(itr->second.c_str(), 0, 10);
|
|
|
|
|
#else
|
|
|
|
|
value = stoi(itr->second);
|
|
|
|
|
@@ -974,7 +974,7 @@
|
|
|
|
|
itr = options.find(ARG_MAX_KEYS);
|
|
|
|
|
if (itr != options.end()) {
|
|
|
|
|
try {
|
|
|
|
|
-#if defined(CYGWIN)
|
|
|
|
|
+#if 1
|
|
|
|
|
max_keys_ = strtol(itr->second.c_str(), 0, 10);
|
|
|
|
|
#else
|
|
|
|
|
max_keys_ = stoi(itr->second);
|
|
|
|
|
@@ -1870,7 +1870,7 @@
|
|
|
|
|
itr = options.find(ARG_MAX_KEYS);
|
|
|
|
|
if (itr != options.end()) {
|
|
|
|
|
try {
|
|
|
|
|
-#if defined(CYGWIN)
|
|
|
|
|
+#if 1
|
|
|
|
|
max_keys_scanned_ = strtol(itr->second.c_str(), 0, 10);
|
|
|
|
|
#else
|
|
|
|
|
max_keys_scanned_ = stoi(itr->second);
|
|
|
|
|
Index: 3rdParty/rocksdb/rocksdb/util/env_posix.cc
|
|
|
|
|
--- 3rdParty/rocksdb/rocksdb/util/env_posix.cc.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/rocksdb/rocksdb/util/env_posix.cc 2017-02-02 23:22:45.179289000 +0100
|
|
|
|
|
@@ -52,6 +52,11 @@
|
|
|
|
|
#include "util/thread_local.h"
|
|
|
|
|
#include "util/thread_status_updater.h"
|
|
|
|
|
|
|
|
|
|
+#if defined(OS_FREEBSD) || defined(__FreeBSD__)
|
|
|
|
|
+#define fdatasync fsync
|
|
|
|
|
+#define fread_unlocked fread
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
#if !defined(TMPFS_MAGIC)
|
|
|
|
|
#define TMPFS_MAGIC 0x01021994
|
|
|
|
|
#endif
|
|
|
|
|
Index: 3rdParty/rocksdb/rocksdb/util/options_builder.cc
|
|
|
|
|
--- 3rdParty/rocksdb/rocksdb/util/options_builder.cc.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/rocksdb/rocksdb/util/options_builder.cc 2017-02-02 23:22:45.179493000 +0100
|
|
|
|
|
@@ -27,7 +27,7 @@
|
|
|
|
|
// Otherwise, calculate a score based on threshold and expected value of
|
|
|
|
|
// two styles, weighing reads 4X important than writes.
|
|
|
|
|
int expected_levels = static_cast<int>(ceil(
|
|
|
|
|
- std::log(target_db_size / write_buffer_size) / std::log(kBytesForLevelMultiplier)));
|
|
|
|
|
+ log(target_db_size / write_buffer_size) / log(kBytesForLevelMultiplier)));
|
|
|
|
|
|
|
|
|
|
int expected_max_files_universal =
|
|
|
|
|
static_cast<int>(ceil(log2(target_db_size / write_buffer_size)));
|
|
|
|
|
@@ -118,8 +118,8 @@
|
|
|
|
|
int write_amplification_threshold,
|
|
|
|
|
uint64_t target_db_size, Options* options) {
|
|
|
|
|
int expected_levels_one_level0_file =
|
|
|
|
|
- static_cast<int>(ceil(std::log(target_db_size / options->write_buffer_size) /
|
|
|
|
|
- std::log(kBytesForLevelMultiplier)));
|
|
|
|
|
+ static_cast<int>(ceil(log(target_db_size / options->write_buffer_size) /
|
|
|
|
|
+ log(kBytesForLevelMultiplier)));
|
|
|
|
|
|
|
|
|
|
int level0_stop_writes_trigger =
|
|
|
|
|
read_amplification_threshold - expected_levels_one_level0_file;
|
|
|
|
|
Index: 3rdParty/rocksdb/rocksdb/util/options_helper.cc
|
|
|
|
|
--- 3rdParty/rocksdb/rocksdb/util/options_helper.cc.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/rocksdb/rocksdb/util/options_helper.cc 2017-02-02 23:22:45.179855000 +0100
|
|
|
|
|
@@ -160,7 +160,7 @@
|
|
|
|
|
|
|
|
|
|
uint64_t ParseUint64(const std::string& value) {
|
|
|
|
|
size_t endchar;
|
|
|
|
|
-#ifndef CYGWIN
|
|
|
|
|
+#if 0
|
|
|
|
|
uint64_t num = std::stoull(value.c_str(), &endchar);
|
|
|
|
|
#else
|
|
|
|
|
char* endptr;
|
|
|
|
|
@@ -198,7 +198,7 @@
|
|
|
|
|
|
|
|
|
|
int ParseInt(const std::string& value) {
|
|
|
|
|
size_t endchar;
|
|
|
|
|
-#ifndef CYGWIN
|
|
|
|
|
+#if 0
|
|
|
|
|
int num = std::stoi(value.c_str(), &endchar);
|
|
|
|
|
#else
|
|
|
|
|
char* endptr;
|
|
|
|
|
@@ -220,7 +220,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
double ParseDouble(const std::string& value) {
|
|
|
|
|
-#ifndef CYGWIN
|
|
|
|
|
+#if 0
|
|
|
|
|
return std::stod(value);
|
|
|
|
|
#else
|
|
|
|
|
return std::strtod(value.c_str(), 0);
|
|
|
|
|
Index: 3rdParty/rocksdb/rocksdb/util/string_util.h
|
|
|
|
|
--- 3rdParty/rocksdb/rocksdb/util/string_util.h.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/rocksdb/rocksdb/util/string_util.h 2017-02-02 23:22:45.180044000 +0100
|
|
|
|
|
@@ -16,7 +16,7 @@
|
|
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
|
inline std::string ToString(T value) {
|
|
|
|
|
-#if !(defined OS_ANDROID) && !(defined CYGWIN)
|
|
|
|
|
+#if 0
|
|
|
|
|
return std::to_string(value);
|
|
|
|
|
#else
|
|
|
|
|
// Andorid or cygwin doesn't support all of C++11, std::to_string() being
|
|
|
|
|
Index: 3rdParty/rocksdb/rocksdb/util/thread_posix.cc
|
|
|
|
|
--- 3rdParty/rocksdb/rocksdb/util/thread_posix.cc.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ 3rdParty/rocksdb/rocksdb/util/thread_posix.cc 2017-02-02 23:22:45.180242000 +0100
|
|
|
|
|
@@ -10,6 +10,7 @@
|
|
|
|
|
#include "util/thread_posix.h"
|
|
|
|
|
#include <atomic>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
+#include <stdlib.h>
|
|
|
|
|
#ifdef OS_LINUX
|
|
|
|
|
#include <sys/syscall.h>
|
|
|
|
|
#endif
|
|
|
|
|
Index: CMakeLists.txt
|
|
|
|
|
--- CMakeLists.txt.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ CMakeLists.txt 2017-02-02 23:22:45.180534000 +0100
|
|
|
|
|
@@ -507,9 +507,10 @@
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
if (NOT WINDOWS)
|
|
|
|
|
- set(SYS_LIBS ${SYS_LIBS} resolv)
|
|
|
|
|
-
|
|
|
|
|
- if (NOT DARWIN)
|
|
|
|
|
+ if (NOT FREEBSD)
|
|
|
|
|
+ set(SYS_LIBS ${SYS_LIBS} resolv)
|
|
|
|
|
+ endif ()
|
|
|
|
|
+ if (NOT DARWIN AND NOT FREEBSD)
|
|
|
|
|
set(SYS_LIBS ${SYS_LIBS} rt)
|
|
|
|
|
endif ()
|
|
|
|
|
endif ()
|
|
|
|
|
@@ -885,6 +886,11 @@
|
|
|
|
|
## SUB-PROJECTS
|
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
|
|
+set(SYS_LIBS ${SYS_LIBS} crypto)
|
|
|
|
|
+set(SYS_LIBS ${SYS_LIBS} ncurses)
|
|
|
|
|
+set(SYS_LIBS ${SYS_LIBS} execinfo)
|
|
|
|
|
+set(SYS_LIBS ${SYS_LIBS} m)
|
|
|
|
|
+
|
|
|
|
|
list(INSERT SYSTEM_LIBRARIES 0
|
|
|
|
|
${BT_LIBS}
|
|
|
|
|
${ZLIB_LIBS}
|
|
|
|
|
Index: arangod/Aql/Condition.cpp
|
|
|
|
|
--- arangod/Aql/Condition.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Aql/Condition.cpp 2017-02-02 23:22:45.180908000 +0100
|
|
|
|
|
@@ -32,6 +32,8 @@
|
|
|
|
|
#include "Logger/Logger.h"
|
|
|
|
|
#include "Utils/Transaction.h"
|
|
|
|
|
|
|
|
|
|
+#include <cmath>
|
|
|
|
|
+
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
// turn off warnings about too long type name for debug symbols blabla in MSVC
|
|
|
|
|
// only...
|
|
|
|
|
Index: arangod/Aql/Expression.cpp
|
|
|
|
|
--- arangod/Aql/Expression.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Aql/Expression.cpp 2017-02-02 23:22:45.181290000 +0100
|
|
|
|
|
@@ -594,7 +594,7 @@
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// stoll() might throw an exception if the string is not a number
|
|
|
|
|
- int64_t position = static_cast<int64_t>(std::stoll(value));
|
|
|
|
|
+ int64_t position = static_cast<int64_t>(strtol(value.c_str(), NULL, 10));
|
|
|
|
|
return result.at(trx, position, mustDestroy, true);
|
|
|
|
|
} catch (...) {
|
|
|
|
|
// no number found.
|
|
|
|
|
Index: arangod/Aql/Functions.cpp
|
|
|
|
|
--- arangod/Aql/Functions.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Aql/Functions.cpp 2017-02-02 23:22:45.182044000 +0100
|
|
|
|
|
@@ -299,10 +299,10 @@
|
|
|
|
|
isValid = true;
|
|
|
|
|
return 0.0;
|
|
|
|
|
}
|
|
|
|
|
- size_t behind = 0;
|
|
|
|
|
- double value = std::stod(str, &behind);
|
|
|
|
|
- while (behind < str.size()) {
|
|
|
|
|
- char c = str[behind];
|
|
|
|
|
+ char *behind = NULL;
|
|
|
|
|
+ double value = strtod(str.c_str(), &behind);
|
|
|
|
|
+ while (behind < str.c_str() + str.size()) {
|
|
|
|
|
+ char c = *behind;
|
|
|
|
|
if (c != ' ' && c != '\t' && c != '\r' && c != '\n' && c != '\f') {
|
|
|
|
|
isValid = false;
|
|
|
|
|
return 0.0;
|
|
|
|
|
@@ -2917,7 +2917,7 @@
|
|
|
|
|
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
|
|
|
|
|
|
|
|
|
|
double input = value.toDouble(trx);
|
|
|
|
|
- return NumberValue(trx, std::log2(input), true);
|
|
|
|
|
+ return NumberValue(trx, log2(input), true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// @brief function LOG10
|
|
|
|
|
@@ -2953,7 +2953,7 @@
|
|
|
|
|
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
|
|
|
|
|
|
|
|
|
|
double input = value.toDouble(trx);
|
|
|
|
|
- return NumberValue(trx, std::exp2(input), true);
|
|
|
|
|
+ return NumberValue(trx, exp2(input), true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// @brief function SIN
|
|
|
|
|
Index: arangod/Aql/ShortestPathNode.cpp
|
|
|
|
|
--- arangod/Aql/ShortestPathNode.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Aql/ShortestPathNode.cpp 2017-02-02 23:22:45.182273000 +0100
|
|
|
|
|
@@ -437,6 +437,6 @@
|
|
|
|
|
|
|
|
|
|
edgesCount += edges;
|
|
|
|
|
}
|
|
|
|
|
- nrItems = edgesCount + static_cast<size_t>(std::log2(nodesEstimate) * nodesEstimate);
|
|
|
|
|
+ nrItems = edgesCount + static_cast<size_t>(log2(nodesEstimate) * nodesEstimate);
|
|
|
|
|
return depCost + nrItems;
|
|
|
|
|
}
|
|
|
|
|
Index: arangod/Aql/SortNode.cpp
|
|
|
|
|
--- arangod/Aql/SortNode.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Aql/SortNode.cpp 2017-02-02 23:22:45.182456000 +0100
|
|
|
|
|
@@ -196,5 +196,5 @@
|
|
|
|
|
if (nrItems <= 3.0) {
|
|
|
|
|
return depCost + nrItems;
|
|
|
|
|
}
|
|
|
|
|
- return depCost + nrItems * std::log2(static_cast<double>(nrItems));
|
|
|
|
|
+ return depCost + nrItems * log2(static_cast<double>(nrItems));
|
|
|
|
|
}
|
|
|
|
|
Index: arangod/Indexes/Index.cpp
|
|
|
|
|
--- arangod/Indexes/Index.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Indexes/Index.cpp 2017-02-02 23:22:45.182719000 +0100
|
|
|
|
|
@@ -534,7 +534,7 @@
|
|
|
|
|
// by default, no sort conditions are supported
|
|
|
|
|
coveredAttributes = 0;
|
|
|
|
|
if (itemsInIndex > 0) {
|
|
|
|
|
- estimatedCost = itemsInIndex * std::log2(itemsInIndex);
|
|
|
|
|
+ estimatedCost = itemsInIndex * log2(itemsInIndex);
|
|
|
|
|
} else {
|
|
|
|
|
estimatedCost = 0.0;
|
|
|
|
|
}
|
|
|
|
|
Index: arangod/Indexes/RocksDBIndex.cpp
|
|
|
|
|
--- arangod/Indexes/RocksDBIndex.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Indexes/RocksDBIndex.cpp 2017-02-02 23:22:45.183020000 +0100
|
|
|
|
|
@@ -833,7 +833,7 @@
|
|
|
|
|
return true;
|
|
|
|
|
} else if (coveredAttributes > 0) {
|
|
|
|
|
estimatedCost = (itemsInIndex / coveredAttributes) *
|
|
|
|
|
- std::log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
+ log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
if (sortCondition->isAscending()) {
|
|
|
|
|
// reverse iteration is more expensive
|
|
|
|
|
estimatedCost *= 4;
|
|
|
|
|
@@ -846,7 +846,7 @@
|
|
|
|
|
coveredAttributes = 0;
|
|
|
|
|
// by default no sort conditions are supported
|
|
|
|
|
if (itemsInIndex > 0) {
|
|
|
|
|
- estimatedCost = itemsInIndex * std::log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
+ estimatedCost = itemsInIndex * log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
// slightly penalize this type of index against other indexes which
|
|
|
|
|
// are in memory
|
|
|
|
|
estimatedCost *= 1.05;
|
|
|
|
|
Index: arangod/Indexes/SkiplistIndex.cpp
|
|
|
|
|
--- arangod/Indexes/SkiplistIndex.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Indexes/SkiplistIndex.cpp 2017-02-02 23:22:45.183342000 +0100
|
|
|
|
|
@@ -35,6 +35,8 @@
|
|
|
|
|
#include <velocypack/Iterator.h>
|
|
|
|
|
#include <velocypack/velocypack-aliases.h>
|
|
|
|
|
|
|
|
|
|
+#include <cmath>
|
|
|
|
|
+
|
|
|
|
|
using namespace arangodb;
|
|
|
|
|
|
|
|
|
|
static size_t sortWeight(arangodb::aql::AstNode const* node) {
|
|
|
|
|
@@ -1404,7 +1406,7 @@
|
|
|
|
|
return true;
|
|
|
|
|
} else if (coveredAttributes > 0) {
|
|
|
|
|
estimatedCost = (itemsInIndex / coveredAttributes) *
|
|
|
|
|
- std::log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
+ log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -1413,7 +1415,7 @@
|
|
|
|
|
coveredAttributes = 0;
|
|
|
|
|
// by default no sort conditions are supported
|
|
|
|
|
if (itemsInIndex > 0) {
|
|
|
|
|
- estimatedCost = itemsInIndex * std::log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
+ estimatedCost = itemsInIndex * log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
} else {
|
|
|
|
|
estimatedCost = 0.0;
|
|
|
|
|
}
|
|
|
|
|
Index: arangod/Scheduler/ListenTask.cpp
|
|
|
|
|
--- arangod/Scheduler/ListenTask.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Scheduler/ListenTask.cpp 2017-02-02 23:22:45.183512000 +0100
|
|
|
|
|
@@ -22,6 +22,11 @@
|
|
|
|
|
/// @author Achim Brandt
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
+#include <sys/types.h>
|
|
|
|
|
+#include <sys/socket.h>
|
|
|
|
|
+#include <netinet/in.h>
|
|
|
|
|
+#include <arpa/inet.h>
|
|
|
|
|
+
|
|
|
|
|
#include "ListenTask.h"
|
|
|
|
|
|
|
|
|
|
#include "GeneralServer/GeneralServerFeature.h"
|
|
|
|
|
Index: arangod/Utils/Transaction.cpp
|
|
|
|
|
--- arangod/Utils/Transaction.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ arangod/Utils/Transaction.cpp 2017-02-02 23:22:45.184142000 +0100
|
|
|
|
|
@@ -119,7 +119,7 @@
|
|
|
|
|
|
|
|
|
|
// index does not support the sort condition
|
|
|
|
|
if (itemsInIndex > 0) {
|
|
|
|
|
- estimatedCost = itemsInIndex * std::log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
+ estimatedCost = itemsInIndex * log2(static_cast<double>(itemsInIndex));
|
|
|
|
|
} else {
|
|
|
|
|
estimatedCost = 0.0;
|
|
|
|
|
}
|
|
|
|
|
Index: etc/arangodb3/arango-dfdb.conf.in
|
|
|
|
|
--- etc/arangodb3/arango-dfdb.conf.in.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ etc/arangodb3/arango-dfdb.conf.in 2017-02-02 23:22:45.184316000 +0100
|
|
|
|
|
@@ -3,7 +3,7 @@
|
|
|
|
|
[database]
|
|
|
|
|
auto-upgrade = false
|
|
|
|
|
upgrade-check = false
|
|
|
|
|
-directory= @LOCALSTATEDIR@/lib/arangodb3
|
|
|
|
|
+directory= @LOCALSTATEDIR@/arangodb
|
|
|
|
|
|
|
|
|
|
[server]
|
|
|
|
|
rest-server = false
|
|
|
|
|
@@ -18,7 +18,7 @@
|
|
|
|
|
|
|
|
|
|
[javascript]
|
|
|
|
|
startup-directory = @PKGDATADIR@/js
|
|
|
|
|
-app-path = @LOCALSTATEDIR@/lib/arangodb3-apps
|
|
|
|
|
+app-path = @LOCALSTATEDIR@/arangodb/apps
|
|
|
|
|
script = @PKGDATADIR@/js/server/arango-dfdb.js
|
|
|
|
|
v8-contexts = 1
|
|
|
|
|
|
|
|
|
|
Index: etc/arangodb3/arangod.conf.in
|
|
|
|
|
--- etc/arangodb3/arangod.conf.in.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ etc/arangodb3/arangod.conf.in 2017-02-02 23:22:45.184476000 +0100
|
|
|
|
|
@@ -5,7 +5,7 @@
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
[database]
|
|
|
|
|
-directory = @LOCALSTATEDIR@/lib/arangodb3
|
|
|
|
|
+directory = @LOCALSTATEDIR@/arangodb
|
|
|
|
|
|
|
|
|
|
# maximal-journal-size = 33554432
|
|
|
|
|
|
|
|
|
|
@@ -53,7 +53,7 @@
|
|
|
|
|
|
|
|
|
|
[javascript]
|
|
|
|
|
startup-directory = @PKGDATADIR@/js
|
|
|
|
|
-app-path = @LOCALSTATEDIR@/lib/arangodb3-apps
|
|
|
|
|
+app-path = @LOCALSTATEDIR@/arangodb/apps
|
|
|
|
|
# app-path = @HOMEDRIVE@/@HOMEPATH@/arangodb3/apps
|
|
|
|
|
|
|
|
|
|
# number of V8 contexts available for JavaScript execution. use 0 to
|
|
|
|
|
@@ -69,6 +69,6 @@
|
|
|
|
|
|
|
|
|
|
[log]
|
|
|
|
|
level = info
|
|
|
|
|
-file = @LOCALSTATEDIR@/log/arangodb3/arangod.log
|
|
|
|
|
+file = @LOCALSTATEDIR@/arangodb/log/arangod.log
|
|
|
|
|
|
|
|
|
|
-[cluster]
|
|
|
|
|
\ No newline at end of file
|
|
|
|
|
+[cluster]
|
|
|
|
|
Index: lib/Basics/operating-system.h
|
|
|
|
|
--- lib/Basics/operating-system.h.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ lib/Basics/operating-system.h 2017-02-02 23:22:45.184737000 +0100
|
|
|
|
|
@@ -436,6 +436,7 @@
|
|
|
|
|
|
|
|
|
|
#define TRI_GCC_THREAD_LOCAL_STORAGE 1
|
|
|
|
|
|
|
|
|
|
+#define TRI_HAVE_SC_PHYS_PAGES 1
|
|
|
|
|
#define TRI_HAVE_LINUX_PROC 1
|
|
|
|
|
#define ARANGODB_HAVE_DOMAIN_SOCKETS 1
|
|
|
|
|
#define TRI_HAVE_POSIX_MMAP 1
|
|
|
|
|
Index: lib/Basics/socket-utils.h
|
|
|
|
|
--- lib/Basics/socket-utils.h.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ lib/Basics/socket-utils.h 2017-02-02 23:22:45.184915000 +0100
|
|
|
|
|
@@ -26,6 +26,11 @@
|
|
|
|
|
|
|
|
|
|
#include "Basics/Common.h"
|
|
|
|
|
|
|
|
|
|
+#include <sys/types.h>
|
|
|
|
|
+#include <sys/socket.h>
|
|
|
|
|
+#include <netinet/in.h>
|
|
|
|
|
+#include <netdb.h>
|
|
|
|
|
+
|
|
|
|
|
#ifdef TRI_HAVE_WINSOCK2_H
|
|
|
|
|
#include <WinSock2.h>
|
|
|
|
|
#include <WS2tcpip.h>
|
|
|
|
|
Index: lib/Endpoint/EndpointIp.cpp
|
|
|
|
|
--- lib/Endpoint/EndpointIp.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ lib/Endpoint/EndpointIp.cpp 2017-02-02 23:22:45.185110000 +0100
|
|
|
|
|
@@ -29,6 +29,10 @@
|
|
|
|
|
|
|
|
|
|
#include "Endpoint/Endpoint.h"
|
|
|
|
|
|
|
|
|
|
+#include <sys/types.h>
|
|
|
|
|
+#include <sys/socket.h>
|
|
|
|
|
+#include <netinet/tcp.h>
|
|
|
|
|
+
|
|
|
|
|
using namespace arangodb;
|
|
|
|
|
using namespace arangodb::basics;
|
|
|
|
|
|
|
|
|
|
Index: lib/Logger/LogAppenderSyslog.cpp
|
|
|
|
|
--- lib/Logger/LogAppenderSyslog.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ lib/Logger/LogAppenderSyslog.cpp 2017-02-02 23:22:45.185269000 +0100
|
|
|
|
|
@@ -64,7 +64,7 @@
|
|
|
|
|
if ('0' <= facility[0] && facility[0] <= '9') {
|
|
|
|
|
value = StringUtils::int32(facility);
|
|
|
|
|
} else {
|
|
|
|
|
- CODE* ptr = reinterpret_cast<CODE*>(TRI_facilitynames);
|
|
|
|
|
+ CODE* ptr = static_cast<CODE*>((CODE *)TRI_facilitynames);
|
|
|
|
|
|
|
|
|
|
while (ptr->c_name != 0) {
|
|
|
|
|
if (strcmp(ptr->c_name, facility.c_str()) == 0) {
|
|
|
|
|
Index: lib/SimpleHttpClient/SimpleHttpClient.cpp
|
|
|
|
|
--- lib/SimpleHttpClient/SimpleHttpClient.cpp.orig 2017-02-02 23:22:45.185671000 +0100
|
|
|
|
|
+++ lib/SimpleHttpClient/SimpleHttpClient.cpp 2017-02-03 21:45:38.194739000 +0100
|
|
|
|
|
@@ -835,7 +835,7 @@
|
|
|
|
|
uint32_t contentLength;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
- contentLength = static_cast<uint32_t>(std::stol(line, nullptr, 16));
|
|
|
|
|
+ contentLength = static_cast<uint32_t>(strtol(line.c_str(), NULL, 16));
|
|
|
|
|
} catch (...) {
|
|
|
|
|
setErrorMessage("found invalid content-length", true);
|
|
|
|
|
// reset connection
|
|
|
|
|
Index: lib/Ssl/SslFeature.cpp
|
|
|
|
|
--- lib/Ssl/SslFeature.cpp.orig 2017-02-02 18:50:53.000000000 +0100
|
|
|
|
|
+++ lib/Ssl/SslFeature.cpp 2017-02-02 23:22:45.185965000 +0100
|
|
|
|
|
@@ -34,10 +34,6 @@
|
|
|
|
|
#include "Random/UniformCharacter.h"
|
|
|
|
|
#include "Ssl/ssl-helper.h"
|
|
|
|
|
|
|
|
|
|
-#ifndef OPENSSL_THREADS
|
|
|
|
|
-#error missing thread support for openssl, please recomple OpenSSL with threads
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
using namespace arangodb;
|
|
|
|
|
using namespace arangodb::basics;
|
|
|
|
|
using namespace arangodb::options;
|