cockroach.patch 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. Index: src/github.com/cockroachdb/cockroach/pkg/cli/start_jemalloc.go
  2. --- src/github.com/cockroachdb/cockroach/pkg/cli/start_jemalloc.go.orig 2016-11-27 12:13:10.000000000 +0100
  3. +++ src/github.com/cockroachdb/cockroach/pkg/cli/start_jemalloc.go 2016-11-27 12:21:20.407531382 +0100
  4. @@ -23,6 +23,7 @@
  5. // #cgo linux CPPFLAGS: -I../../vendor/github.com/cockroachdb/c-jemalloc/linux_includes/internal/include
  6. // #cgo darwin LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup
  7. // #cgo linux LDFLAGS: -Wl,-unresolved-symbols=ignore-all
  8. +// #cgo freebsd LDFLAGS: -Wl,-unresolved-symbols=ignore-all
  9. //
  10. // #include <jemalloc/jemalloc.h>
  11. // #include <stddef.h>
  12. Index: src/github.com/cockroachdb/cockroach/pkg/server/config.go
  13. --- src/github.com/cockroachdb/cockroach/pkg/server/config.go.orig 2016-11-27 12:13:10.000000000 +0100
  14. +++ src/github.com/cockroachdb/cockroach/pkg/server/config.go 2016-11-27 12:21:20.407531382 +0100
  15. @@ -248,7 +248,7 @@
  16. }
  17. // The max open file descriptor limit is too low.
  18. - if rLimit.Max < minimumOpenFileLimit {
  19. + if uint64(rLimit.Max) < minimumOpenFileLimit {
  20. return 0, fmt.Errorf("hard open file descriptor limit of %d is under the minimum required %d\n%s",
  21. rLimit.Max,
  22. minimumOpenFileLimit,
  23. @@ -257,24 +257,24 @@
  24. // If current open file descriptor limit is higher than the recommended
  25. // value, we can just use the default value.
  26. - if rLimit.Cur > recommendedOpenFileLimit {
  27. + if uint64(rLimit.Cur) > recommendedOpenFileLimit {
  28. return engine.DefaultMaxOpenFiles, nil
  29. }
  30. // If the current limit is less than the recommended limit, set the current
  31. // limit to the minimum of the max limit or the recommendedOpenFileLimit.
  32. var newCurrent uint64
  33. - if rLimit.Max > recommendedOpenFileLimit {
  34. + if uint64(rLimit.Max) > recommendedOpenFileLimit {
  35. newCurrent = recommendedOpenFileLimit
  36. } else {
  37. - newCurrent = rLimit.Max
  38. + newCurrent = uint64(rLimit.Max)
  39. }
  40. - if rLimit.Cur < newCurrent {
  41. + if uint64(rLimit.Cur) < newCurrent {
  42. if log.V(1) {
  43. log.Infof(context.TODO(), "setting the soft limit for open file descriptors from %d to %d",
  44. rLimit.Cur, newCurrent)
  45. }
  46. - rLimit.Cur = newCurrent
  47. + rLimit.Cur = int64(newCurrent)
  48. if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit); err != nil {
  49. return 0, err
  50. }
  51. @@ -289,7 +289,7 @@
  52. }
  53. // The current open file descriptor limit is still too low.
  54. - if rLimit.Cur < minimumOpenFileLimit {
  55. + if uint64(rLimit.Cur) < minimumOpenFileLimit {
  56. return 0, fmt.Errorf("soft open file descriptor limit of %d is under the minimum required %d and cannot be increased\n%s",
  57. rLimit.Cur,
  58. minimumOpenFileLimit,
  59. @@ -297,7 +297,7 @@
  60. }
  61. // If we have the desired number, just use the default values.
  62. - if rLimit.Cur >= recommendedOpenFileLimit {
  63. + if uint64(rLimit.Cur) >= recommendedOpenFileLimit {
  64. return engine.DefaultMaxOpenFiles, nil
  65. }
  66. @@ -316,7 +316,7 @@
  67. // If we have more than enough file descriptors to hit the recommend number
  68. // for each store, than only constrain the network ones by giving the stores
  69. // their full recommended number.
  70. - if rLimit.Cur >= networkConstrainedFileLimit {
  71. + if uint64(rLimit.Cur) >= networkConstrainedFileLimit {
  72. return engine.DefaultMaxOpenFiles, nil
  73. }
  74. Index: src/github.com/cockroachdb/cockroach/pkg/server/status/runtime_jemalloc.go
  75. --- src/github.com/cockroachdb/cockroach/pkg/server/status/runtime_jemalloc.go.orig 2016-11-27 12:13:10.000000000 +0100
  76. +++ src/github.com/cockroachdb/cockroach/pkg/server/status/runtime_jemalloc.go 2016-11-27 12:21:20.407531382 +0100
  77. @@ -23,6 +23,7 @@
  78. // #cgo linux CPPFLAGS: -I../../../vendor/github.com/cockroachdb/c-jemalloc/linux_includes/internal/include
  79. // #cgo darwin LDFLAGS: -Wl,-undefined -Wl,dynamic_lookup
  80. // #cgo linux LDFLAGS: -Wl,-unresolved-symbols=ignore-all
  81. +// #cgo freebsd LDFLAGS: -Wl,-unresolved-symbols=ignore-all
  82. //
  83. // #include <jemalloc/jemalloc.h>
  84. //
  85. Index: src/github.com/cockroachdb/cockroach/pkg/storage/engine/rocksdb/db.cc
  86. --- src/github.com/cockroachdb/cockroach/pkg/storage/engine/rocksdb/db.cc.orig 2016-11-27 12:13:10.000000000 +0100
  87. +++ src/github.com/cockroachdb/cockroach/pkg/storage/engine/rocksdb/db.cc 2016-11-27 12:21:20.407531382 +0100
  88. @@ -1847,10 +1847,10 @@
  89. (int64_t)s->getTickerCount(rocksdb::BLOOM_FILTER_PREFIX_USEFUL);
  90. stats->memtable_hits = (int64_t)s->getTickerCount(rocksdb::MEMTABLE_HIT);
  91. stats->memtable_misses = (int64_t)s->getTickerCount(rocksdb::MEMTABLE_MISS);
  92. - stats->memtable_total_size = std::stoll(memtable_total_size);
  93. + stats->memtable_total_size = std::strtol(memtable_total_size.c_str(), NULL, 10);
  94. stats->flushes = (int64_t)event_listener->GetFlushes();
  95. stats->compactions = (int64_t)event_listener->GetCompactions();
  96. - stats->table_readers_mem_estimate = std::stoll(table_readers_mem_estimate);
  97. + stats->table_readers_mem_estimate = std::strtol(table_readers_mem_estimate.c_str(), NULL, 10);
  98. return kSuccess;
  99. }
  100. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/map.h
  101. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/map.h.orig 2016-11-27 12:13:18.000000000 +0100
  102. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/map.h 2016-11-27 12:21:20.397573831 +0100
  103. @@ -613,10 +613,7 @@
  104. }
  105. }
  106. -#if __cplusplus >= 201103L && !defined(GOOGLE_PROTOBUF_OS_APPLE) && \
  107. - !defined(GOOGLE_PROTOBUF_OS_NACL) && \
  108. - !defined(GOOGLE_PROTOBUF_OS_ANDROID) && \
  109. - !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN)
  110. +#if 0
  111. template<class NodeType, class... Args>
  112. void construct(NodeType* p, Args&&... args) {
  113. // Clang 3.6 doesn't compile static casting to void* directly. (Issue
  114. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathlimits.h
  115. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathlimits.h.orig 2016-11-27 12:13:18.000000000 +0100
  116. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathlimits.h 2016-11-27 12:21:20.397573831 +0100
  117. @@ -48,7 +48,7 @@
  118. // include <cmath> because that breaks the definition of isinf with gcc 4.9.
  119. //
  120. // TODO(mec): after C++11 everywhere, use <cmath> and std::isinf in this file.
  121. -#include <math.h>
  122. +#include <cmath>
  123. #include <string.h>
  124. #include <cfloat>
  125. @@ -230,11 +230,11 @@
  126. static bool IsNegInf(const Type x) { return _fpclass(x) == _FPCLASS_NINF; }
  127. #else
  128. #define DECL_FP_LIMIT_FUNCS \
  129. - static bool IsFinite(const Type x) { return !isinf(x) && !isnan(x); } \
  130. - static bool IsNaN(const Type x) { return isnan(x); } \
  131. - static bool IsInf(const Type x) { return isinf(x); } \
  132. - static bool IsPosInf(const Type x) { return isinf(x) && x > 0; } \
  133. - static bool IsNegInf(const Type x) { return isinf(x) && x < 0; }
  134. + static bool IsFinite(const Type x) { return !std::isinf(x) && !std::isnan(x); } \
  135. + static bool IsNaN(const Type x) { return std::isnan(x); } \
  136. + static bool IsInf(const Type x) { return std::isinf(x); } \
  137. + static bool IsPosInf(const Type x) { return std::isinf(x) && x > 0; } \
  138. + static bool IsNegInf(const Type x) { return std::isinf(x) && x < 0; }
  139. #endif
  140. // We can't put floating-point constant values in the header here because
  141. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathutil.h
  142. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathutil.h.orig 2016-11-27 12:13:18.000000000 +0100
  143. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/mathutil.h 2016-11-27 12:21:20.397573831 +0100
  144. @@ -31,7 +31,7 @@
  145. #define GOOGLE_PROTOBUF_STUBS_MATHUTIL_H_
  146. #include <float.h>
  147. -#include <math.h>
  148. +#include <cmath>
  149. #include <google/protobuf/stubs/common.h>
  150. #include <google/protobuf/stubs/logging.h>
  151. @@ -49,7 +49,7 @@
  152. #ifdef _MSC_VER
  153. return _isnan(value);
  154. #else
  155. - return isnan(value);
  156. + return std::isnan(value);
  157. #endif
  158. }
  159. template<>
  160. @@ -57,7 +57,7 @@
  161. #ifdef _MSC_VER
  162. return _isnan(value);
  163. #else
  164. - return isnan(value);
  165. + return std::isnan(value);
  166. #endif
  167. }
  168. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/shared_ptr.h
  169. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/shared_ptr.h.orig 2016-11-27 12:13:18.000000000 +0100
  170. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-protobuf/internal/src/google/protobuf/stubs/shared_ptr.h 2016-11-27 12:21:20.397573831 +0100
  171. @@ -50,7 +50,7 @@
  172. #define UTIL_GTL_USE_STD_SHARED_PTR 1
  173. #endif
  174. -#if defined(UTIL_GTL_USE_STD_SHARED_PTR) && UTIL_GTL_USE_STD_SHARED_PTR
  175. +#if 0
  176. // These are transitional. They will be going away soon.
  177. // Please just #include <memory> and just type std::shared_ptr yourself, instead
  178. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/cgo_flags.go
  179. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/cgo_flags.go.orig 2016-11-27 12:13:18.000000000 +0100
  180. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/cgo_flags.go 2016-11-27 12:21:20.397573831 +0100
  181. @@ -11,9 +11,7 @@
  182. // #cgo linux CPPFLAGS: -DOS_LINUX -fno-builtin-memcmp -DROCKSDB_FALLOCATE_PRESENT -DROCKSDB_MALLOC_USABLE_SIZE
  183. // #cgo freebsd CPPFLAGS: -DOS_FREEBSD
  184. // #cgo dragonfly CPPFLAGS: -DOS_DRAGONFLY
  185. +// #cgo CXXFLAGS: -Wno-unused-parameter
  186. // #cgo CXXFLAGS: -std=c++11 -fno-omit-frame-pointer -momit-leaf-frame-pointer
  187. -// #cgo darwin CXXFLAGS: -Wshorten-64-to-32
  188. -// #cgo freebsd CXXFLAGS: -Wshorten-64-to-32
  189. -// #cgo dragonfly CXXFLAGS: -Wshorten-64-to-32
  190. // #cgo windows LDFLAGS: -lrpcrt4
  191. import "C"
  192. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/build_detect_platform
  193. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/build_detect_platform.orig 2016-11-27 12:13:18.000000000 +0100
  194. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/build_detect_platform 2016-11-27 12:21:20.397573831 +0100
  195. @@ -374,18 +374,6 @@
  196. fi
  197. fi
  198. -# TODO(tec): Fix -Wshorten-64-to-32 errors on FreeBSD and enable the warning.
  199. -# -Wshorten-64-to-32 breaks compilation on FreeBSD i386
  200. -if ! [ "$TARGET_OS" = FreeBSD -a "$TARGET_ARCHITECTURE" = i386 ]; then
  201. - # Test whether -Wshorten-64-to-32 is available
  202. - $CXX $CFLAGS -x c++ - -o /dev/null -Wshorten-64-to-32 2>/dev/null <<EOF
  203. - int main() {}
  204. -EOF
  205. - if [ "$?" = 0 ]; then
  206. - COMMON_FLAGS="$COMMON_FLAGS -Wshorten-64-to-32"
  207. - fi
  208. -fi
  209. -
  210. # shall we use HDFS?
  211. if test "$USE_HDFS"; then
  212. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/fbcode_config.sh
  213. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/fbcode_config.sh.orig 2016-11-27 12:13:18.000000000 +0100
  214. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/build_tools/fbcode_config.sh 2016-11-27 12:21:20.397573831 +0100
  215. @@ -126,7 +126,7 @@
  216. EXEC_LDFLAGS+=" $LIBUNWIND"
  217. EXEC_LDFLAGS+=" -Wl,-rpath=/usr/local/fbcode/gcc-4.9-glibc-2.20/lib"
  218. -PLATFORM_LDFLAGS="$LIBGCC_LIBS $GLIBC_LIBS $STDLIBS -lgcc -lstdc++"
  219. +PLATFORM_LDFLAGS="$LIBGCC_LIBS $GLIBC_LIBS $STDLIBS -lstdc++"
  220. EXEC_LDFLAGS_SHARED="$SNAPPY_LIBS $ZLIB_LIBS $BZIP_LIBS $LZ4_LIBS $ZSTD_LIBS $GFLAGS_LIBS"
  221. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/port/port_posix.h
  222. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/port/port_posix.h.orig 2016-11-27 12:13:18.000000000 +0100
  223. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/port/port_posix.h 2016-11-27 12:21:20.397573831 +0100
  224. @@ -27,7 +27,7 @@
  225. #define PLATFORM_IS_LITTLE_ENDIAN \
  226. (__DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN)
  227. #endif
  228. -#elif defined(OS_SOLARIS)
  229. +#elif defined(OS_SOLARIS) || defined(__sun)
  230. #include <sys/isa_defs.h>
  231. #ifdef _LITTLE_ENDIAN
  232. #define PLATFORM_IS_LITTLE_ENDIAN true
  233. @@ -35,7 +35,7 @@
  234. #define PLATFORM_IS_LITTLE_ENDIAN false
  235. #endif
  236. #elif defined(OS_FREEBSD) || defined(OS_OPENBSD) || defined(OS_NETBSD) || \
  237. - defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID)
  238. + defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID) || defined(__FreeBSD__)
  239. #include <sys/endian.h>
  240. #include <sys/types.h>
  241. #define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN)
  242. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/env_posix.cc
  243. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/env_posix.cc.orig 2016-11-27 12:13:18.000000000 +0100
  244. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/env_posix.cc 2016-11-27 12:21:20.397573831 +0100
  245. @@ -52,6 +52,11 @@
  246. #include "util/thread_local.h"
  247. #include "util/thread_status_updater.h"
  248. +#if defined(OS_FREEBSD) || defined(__FreeBSD__)
  249. +#define fdatasync fsync
  250. +#define fread_unlocked fread
  251. +#endif
  252. +
  253. #if !defined(TMPFS_MAGIC)
  254. #define TMPFS_MAGIC 0x01021994
  255. #endif
  256. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_builder.cc
  257. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_builder.cc.orig 2016-11-27 12:13:18.000000000 +0100
  258. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_builder.cc 2016-11-27 12:21:20.397573831 +0100
  259. @@ -26,7 +26,7 @@
  260. // Otherwise, calculate a score based on threshold and expected value of
  261. // two styles, weighing reads 4X important than writes.
  262. int expected_levels = static_cast<int>(ceil(
  263. - std::log(target_db_size / write_buffer_size) / std::log(kBytesForLevelMultiplier)));
  264. + log(target_db_size / write_buffer_size) / log(kBytesForLevelMultiplier)));
  265. int expected_max_files_universal =
  266. static_cast<int>(ceil(log2(target_db_size / write_buffer_size)));
  267. @@ -117,8 +117,8 @@
  268. int write_amplification_threshold,
  269. uint64_t target_db_size, Options* options) {
  270. int expected_levels_one_level0_file =
  271. - static_cast<int>(ceil(std::log(target_db_size / options->write_buffer_size) /
  272. - std::log(kBytesForLevelMultiplier)));
  273. + static_cast<int>(ceil(log(target_db_size / options->write_buffer_size) /
  274. + log(kBytesForLevelMultiplier)));
  275. int level0_stop_writes_trigger =
  276. read_amplification_threshold - expected_levels_one_level0_file;
  277. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_helper.cc
  278. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_helper.cc.orig 2016-11-27 12:13:18.000000000 +0100
  279. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/options_helper.cc 2016-11-27 12:21:20.397573831 +0100
  280. @@ -160,7 +160,7 @@
  281. uint64_t ParseUint64(const std::string& value) {
  282. size_t endchar;
  283. -#ifndef CYGWIN
  284. +#if 0
  285. uint64_t num = std::stoull(value.c_str(), &endchar);
  286. #else
  287. char* endptr;
  288. @@ -198,7 +198,7 @@
  289. int ParseInt(const std::string& value) {
  290. size_t endchar;
  291. -#ifndef CYGWIN
  292. +#if 0
  293. int num = std::stoi(value.c_str(), &endchar);
  294. #else
  295. char* endptr;
  296. @@ -220,7 +220,7 @@
  297. }
  298. double ParseDouble(const std::string& value) {
  299. -#ifndef CYGWIN
  300. +#if 0
  301. return std::stod(value);
  302. #else
  303. return std::strtod(value.c_str(), 0);
  304. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/string_util.h
  305. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/string_util.h.orig 2016-11-27 12:13:18.000000000 +0100
  306. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/string_util.h 2016-11-27 12:21:20.397573831 +0100
  307. @@ -16,15 +16,9 @@
  308. template <typename T>
  309. inline std::string ToString(T value) {
  310. -#if !(defined OS_ANDROID) && !(defined CYGWIN)
  311. - return std::to_string(value);
  312. -#else
  313. - // Andorid or cygwin doesn't support all of C++11, std::to_string() being
  314. - // one of the not supported features.
  315. std::ostringstream os;
  316. os << value;
  317. return os.str();
  318. -#endif
  319. }
  320. } // namespace rocksdb
  321. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/thread_posix.cc
  322. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/thread_posix.cc.orig 2016-11-27 12:13:18.000000000 +0100
  323. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/thread_posix.cc 2016-11-27 12:21:20.397573831 +0100
  324. @@ -10,6 +10,7 @@
  325. #include "util/thread_posix.h"
  326. #include <atomic>
  327. #include <unistd.h>
  328. +#include <stdlib.h>
  329. #ifdef OS_LINUX
  330. #include <sys/syscall.h>
  331. #endif
  332. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/transaction_test_util.cc
  333. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/transaction_test_util.cc.orig 2016-11-27 12:13:18.000000000 +0100
  334. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/util/transaction_test_util.cc 2016-11-27 12:21:20.407531382 +0100
  335. @@ -94,7 +94,7 @@
  336. if (s.ok()) {
  337. // Found key, parse its value
  338. - int_value = std::stoull(value);
  339. + int_value = strtol(value.c_str(), NULL, 10);
  340. if (int_value == 0 || int_value == ULONG_MAX) {
  341. unexpected_error = true;
  342. @@ -205,7 +205,7 @@
  343. }
  344. Slice value = iter->value();
  345. - uint64_t int_value = std::stoull(value.ToString());
  346. + uint64_t int_value = strtol(value.ToString().c_str(), NULL, 10);
  347. if (int_value == 0 || int_value == ULONG_MAX) {
  348. fprintf(stderr, "Iter returned unexpected value: %s\n",
  349. value.ToString().c_str());
  350. Index: src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/utilities/geodb/geodb_impl.cc
  351. --- src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/utilities/geodb/geodb_impl.cc.orig 2016-11-27 12:13:18.000000000 +0100
  352. +++ src/github.com/cockroachdb/cockroach/vendor/github.com/cockroachdb/c-rocksdb/internal/utilities/geodb/geodb_impl.cc 2016-11-27 12:21:20.407531382 +0100
  353. @@ -354,7 +354,7 @@
  354. // how many level of details to look for
  355. int numberOfTilesAtMaxDepth = static_cast<int>(std::floor((bottomRight.x - topLeft.x) / 256));
  356. - int zoomLevelsToRise = static_cast<int>(std::floor(std::log(numberOfTilesAtMaxDepth) / std::log(2)));
  357. + int zoomLevelsToRise = static_cast<int>(std::floor(log(numberOfTilesAtMaxDepth) / log(2)));
  358. zoomLevelsToRise++;
  359. int levels = std::max(0, Detail - zoomLevelsToRise);
  360. @@ -391,7 +391,7 @@
  361. double latitude = clip(pos.latitude, MinLatitude, MaxLatitude);
  362. double x = (pos.longitude + 180) / 360;
  363. double sinLatitude = sin(latitude * PI / 180);
  364. - double y = 0.5 - std::log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * PI);
  365. + double y = 0.5 - log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * PI);
  366. double mapSize = MapSize(levelOfDetail);
  367. double X = std::floor(clip(x * mapSize + 0.5, 0, mapSize - 1));
  368. double Y = std::floor(clip(y * mapSize + 0.5, 0, mapSize - 1));