Unbreak librocksdb-sys crate build after LLVM 10 import

In file included from rocksdb/utilities/backupable/backupable_db.cc:16:
rocksdb/util/channel.h:35:33: error: no matching constructor for initialization of 'std::lock_guard<std::mutex>'
    std::lock_guard<std::mutex> lk(lock_);
                                ^  ~~~~~
/usr/include/c++/v1/__mutex_base:90:14: note: candidate constructor not viable: 1st argument ('const std::mutex') would lose const qualifier
    explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
             ^
/usr/include/c++/v1/__mutex_base💯5: note: candidate constructor not viable: no known conversion from 'const std::mutex' to 'const std::__1::lock_guard<std::__1::mutex>' for 1st argument
    lock_guard(lock_guard const&) _LIBCPP_EQUAL_DELETE;
    ^
/usr/include/c++/v1/__mutex_base:94:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
    ^
1 error generated.
This commit is contained in:
Tobias Kortkamp 2020-03-17 22:34:58 +00:00
parent 8f23b03499
commit 4184a53a5e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=528607
2 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,28 @@
In file included from rocksdb/utilities/backupable/backupable_db.cc:16:
rocksdb/util/channel.h:35:33: error: no matching constructor for initialization of 'std::lock_guard<std::mutex>'
std::lock_guard<std::mutex> lk(lock_);
^ ~~~~~
/usr/include/c++/v1/__mutex_base:90:14: note: candidate constructor not viable: 1st argument ('const std::mutex') would lose const qualifier
explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
^
/usr/include/c++/v1/__mutex_base:100:5: note: candidate constructor not viable: no known conversion from 'const std::mutex' to 'const std::__1::lock_guard<std::__1::mutex>' for 1st argument
lock_guard(lock_guard const&) _LIBCPP_EQUAL_DELETE;
^
/usr/include/c++/v1/__mutex_base:94:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
^
1 error generated.
https://github.com/facebook/rocksdb/commit/a796c06fef6a8e43d793f8e627db3f29e6f95964
--- cargo-crates/librocksdb-sys-6.2.4/rocksdb/util/channel.h.orig 2020-03-15 20:19:45 UTC
+++ cargo-crates/librocksdb-sys-6.2.4/rocksdb/util/channel.h
@@ -60,7 +60,7 @@ class channel {
private:
std::condition_variable cv_;
- std::mutex lock_;
+ mutable std::mutex lock_;
std::queue<T> buffer_;
bool eof_;
};

View File

@ -0,0 +1,28 @@
In file included from rocksdb/utilities/backupable/backupable_db.cc:16:
rocksdb/util/channel.h:35:33: error: no matching constructor for initialization of 'std::lock_guard<std::mutex>'
std::lock_guard<std::mutex> lk(lock_);
^ ~~~~~
/usr/include/c++/v1/__mutex_base:90:14: note: candidate constructor not viable: 1st argument ('const std::mutex') would lose const qualifier
explicit lock_guard(mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
^
/usr/include/c++/v1/__mutex_base:100:5: note: candidate constructor not viable: no known conversion from 'const std::mutex' to 'const std::__1::lock_guard<std::__1::mutex>' for 1st argument
lock_guard(lock_guard const&) _LIBCPP_EQUAL_DELETE;
^
/usr/include/c++/v1/__mutex_base:94:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
lock_guard(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m))
^
1 error generated.
https://github.com/facebook/rocksdb/commit/a796c06fef6a8e43d793f8e627db3f29e6f95964
--- cargo-crates/librocksdb-sys-6.1.3/rocksdb/util/channel.h.orig 2020-03-15 20:19:45 UTC
+++ cargo-crates/librocksdb-sys-6.1.3/rocksdb/util/channel.h
@@ -60,7 +60,7 @@ class channel {
private:
std::condition_variable cv_;
- std::mutex lock_;
+ mutable std::mutex lock_;
std::queue<T> buffer_;
bool eof_;
};