Fix #1110, 32-bit build failure on Mac OSX #1112
Merged
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.
Using explicit 64-bit type in conditional in platforms above 32-bits
std::conditional does not appear to short circuit before evaluating the third template arg which results in an error because the constant value does not fit in a 32-bit size_t. This is a warning in a linux environment but an error in Mac OSX
The solution is to just make the third argument type explicitly 64-bit. The entire expression then either becomes a 32-bit constant or a 64-bit constant holding a 32-bit value, but in either case is assignable to a 32-bit size_t.
This works correctly in the following cases:
32-bit: a 32-bit value will be assigned to a 32-bit size_t.
64-bit: size_t and uint64_t are the same size so the assignment is fine.