Merged
Conversation
This is ugly, but temporary. boost::filesystem will likely be dropped soon after c++11 is enabled. Otherwise, we could simply roll our own copy_file. I've fixed this at the buildsystem level for now in order to avoid mixing in functional changes. Explanation: If boost (prior to 1.57) was built without c++11, it emulated scoped enums using c++98 constructs. Unfortunately, this implementation detail leaked into the abi. This was fixed in 1.57. When building against that installed version using c++11, the headers pick up on the native c++11 scoped enum support and enable it, however it will fail to link. This can be worked around by disabling c++11 scoped enums if linking will fail. Add an autoconf test to determine incompatibility. At build-time, if native enums are being used (a c++11 build), and force-disabling them causes a successful link, we can be sure that there's an incompatibility and enable the work-around.
noexcept is default for destructors as of c++11. By throwing in reverselock's destructor if it's lock has been tampered with, the likely result is std::terminate being called. Indeed that happened before this change. Once reverselock has taken another lock (its ctor didn't throw), it makes no sense to try to grab or lock the parent lock. That is be broken/undefined behavior depending on the parent lock's implementation, but it shouldn't cause the reverselock to fail to re-lock when destroyed. To avoid those problems, simply swap the parent lock's contents with a dummy for the duration of the lock. That will ensure that any undefined behavior is caught at the call-site rather than the reverse lock's destruction. Barring a failed mutex unlock which would be indicative of a larger problem, the destructor should now never throw.
c++11ism. This fixes builds against libc++.
atomic_init clashes with
Contributor
|
utACK 3968922 |
Member
|
conceptACK, will start testing shortly. On Wednesday, 6 January 2016, Daniel Cousens [email protected]
|
Contributor
|
code review ACK. |
Member
|
utACK 3968922 |
Contributor
|
utACK |
1 similar comment
Member
|
utACK |
Contributor
|
minor nits: new Will we use C++11 like we use C++? Ie. capital C? Or is small c ok? Can you please add a comment to Otherwise ACK |
Member
|
utACK |
laanwj
added a commit
that referenced
this pull request
Jan 7, 2016
3968922 c++11: fix libbdb build against libc++ in c++11 mode (Cory Fields) 57d2f62 c++11: CAccountingEntry must be defined before use in a list (Cory Fields) 89f71c6 c++11: don't throw from the reverselock destructor (Cory Fields) 76ac35f c++11: detect and correct for boost builds with an incompatible abi (Cory Fields)
zkbot
added a commit
to zcash/zcash
that referenced
this pull request
Nov 30, 2017
Darwin build fixes Includes fixes cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7136 - Only the third commit (to avoid a merge conflict) - bitcoin/bitcoin#7302 - Excluding the first commit, which is unnecessary (we use Boost 1.62) - bitcoin/bitcoin#7487 - bitcoin/bitcoin#7606 - bitcoin/bitcoin#7711 - bitcoin/bitcoin#7165 - bitcoin/bitcoin#8002 - bitcoin/bitcoin#8210 - Only the second commit - bitcoin/bitcoin#9114
zkbot
added a commit
to zcash/zcash
that referenced
this pull request
Nov 30, 2017
Darwin build fixes Includes fixes cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7136 - Only the third commit (to avoid a merge conflict) - bitcoin/bitcoin#7302 - Excluding the first commit, which is unnecessary (we use Boost 1.62) - bitcoin/bitcoin#7487 - bitcoin/bitcoin#7606 - bitcoin/bitcoin#7711 - bitcoin/bitcoin#7165 - bitcoin/bitcoin#8002 - bitcoin/bitcoin#8210 - Only the second commit - bitcoin/bitcoin#9114
zkbot
added a commit
to zcash/zcash
that referenced
this pull request
Nov 30, 2017
Darwin build fixes Includes fixes cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7136 - Only the third commit (to avoid a merge conflict) - bitcoin/bitcoin#7302 - Excluding the first commit, which is unnecessary (we use Boost 1.62) - bitcoin/bitcoin#7487 - bitcoin/bitcoin#7606 - bitcoin/bitcoin#7711 - bitcoin/bitcoin#7165 - bitcoin/bitcoin#8002 - bitcoin/bitcoin#8210 - Only the second commit - bitcoin/bitcoin#9114
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In preparation for switching to the c++11 requirement, I've done depends builds on all supported OSs and fixed up any snags along the way.
Note that this does not enable c++11 anywhere, it simply enables c++11 builds to pass.
Once merged, we can begin moving forward with enabling.