Address noexcept and const integer lambda capture

VS 2013 does not support noexcept.
   Complains about usage of ineteger constant within lambda requiring explicit capture.
main
Dmitri Smirnov 9 years ago
parent 53b88784df
commit 6924d7582b
  1. 2
      db/db_test.cc
  2. 2
      port/port_posix.h
  3. 2
      port/win/port_win.h
  4. 13
      utilities/backupable/backupable_db.cc

@ -6327,7 +6327,7 @@ TEST_F(DBTest, DynamicMemtableOptions) {
options.level0_stop_writes_trigger = 1024; options.level0_stop_writes_trigger = 1024;
DestroyAndReopen(options); DestroyAndReopen(options);
auto gen_l0_kb = [this](int size) { auto gen_l0_kb = [this, kNumPutsBeforeWaitForFlush](int size) {
Random rnd(301); Random rnd(301);
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
ASSERT_OK(Put(Key(i), RandomString(&rnd, 1024))); ASSERT_OK(Put(Key(i), RandomString(&rnd, 1024)));

@ -16,6 +16,8 @@
// in fact, we could use that one // in fact, we could use that one
#define ROCKSDB_PRIszt "zu" #define ROCKSDB_PRIszt "zu"
#define NOEXCEPT noexcept
#undef PLATFORM_IS_LITTLE_ENDIAN #undef PLATFORM_IS_LITTLE_ENDIAN
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
#include <machine/endian.h> #include <machine/endian.h>

@ -58,6 +58,8 @@ typedef SSIZE_T ssize_t;
#define ROCKSDB_PRIszt "Iu" #define ROCKSDB_PRIszt "Iu"
#endif #endif
#define NOEXCEPT
#define __attribute__(A) #define __attribute__(A)
#ifdef ZLIB #ifdef ZLIB

@ -18,6 +18,7 @@
#include "util/logging.h" #include "util/logging.h"
#include "util/string_util.h" #include "util/string_util.h"
#include "rocksdb/transaction_log.h" #include "rocksdb/transaction_log.h"
#include "port/port.h"
#ifndef __STDC_FORMAT_MACROS #ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
@ -343,9 +344,9 @@ class BackupEngineImpl : public BackupEngine {
CopyWorkItem(const CopyWorkItem&) = delete; CopyWorkItem(const CopyWorkItem&) = delete;
CopyWorkItem& operator=(const CopyWorkItem&) = delete; CopyWorkItem& operator=(const CopyWorkItem&) = delete;
CopyWorkItem(CopyWorkItem&& o) noexcept { *this = std::move(o); } CopyWorkItem(CopyWorkItem&& o) NOEXCEPT { *this = std::move(o); }
CopyWorkItem& operator=(CopyWorkItem&& o) noexcept { CopyWorkItem& operator=(CopyWorkItem&& o) NOEXCEPT {
src_path = std::move(o.src_path); src_path = std::move(o.src_path);
dst_path = std::move(o.dst_path); dst_path = std::move(o.dst_path);
src_env = o.src_env; src_env = o.src_env;
@ -383,11 +384,11 @@ class BackupEngineImpl : public BackupEngine {
std::string dst_relative; std::string dst_relative;
BackupAfterCopyWorkItem() {} BackupAfterCopyWorkItem() {}
BackupAfterCopyWorkItem(BackupAfterCopyWorkItem&& o) noexcept { BackupAfterCopyWorkItem(BackupAfterCopyWorkItem&& o) NOEXCEPT {
*this = std::move(o); *this = std::move(o);
} }
BackupAfterCopyWorkItem& operator=(BackupAfterCopyWorkItem&& o) noexcept { BackupAfterCopyWorkItem& operator=(BackupAfterCopyWorkItem&& o) NOEXCEPT {
result = std::move(o.result); result = std::move(o.result);
shared = o.shared; shared = o.shared;
needed_to_copy = o.needed_to_copy; needed_to_copy = o.needed_to_copy;
@ -418,11 +419,11 @@ class BackupEngineImpl : public BackupEngine {
RestoreAfterCopyWorkItem(std::future<CopyResult>&& _result, RestoreAfterCopyWorkItem(std::future<CopyResult>&& _result,
uint32_t _checksum_value) uint32_t _checksum_value)
: result(std::move(_result)), checksum_value(_checksum_value) {} : result(std::move(_result)), checksum_value(_checksum_value) {}
RestoreAfterCopyWorkItem(RestoreAfterCopyWorkItem&& o) noexcept { RestoreAfterCopyWorkItem(RestoreAfterCopyWorkItem&& o) NOEXCEPT {
*this = std::move(o); *this = std::move(o);
} }
RestoreAfterCopyWorkItem& operator=(RestoreAfterCopyWorkItem&& o) noexcept { RestoreAfterCopyWorkItem& operator=(RestoreAfterCopyWorkItem&& o) NOEXCEPT {
result = std::move(o.result); result = std::move(o.result);
checksum_value = o.checksum_value; checksum_value = o.checksum_value;
return *this; return *this;

Loading…
Cancel
Save