mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Work around VS2019 16.4.0 bugs (#2171)
Work around frontend bug in scoped_lock and code generation bug in reverse_iterator in gtest. See https://github.com/google/googletest/pull/2635
This commit is contained in:
@@ -412,7 +412,11 @@ std::unique_ptr<PropertyImpl> HttpCameraImpl::CreateEmptyProperty(
|
||||
}
|
||||
|
||||
bool HttpCameraImpl::CacheProperties(CS_Status* status) const {
|
||||
#ifdef _MSC_VER // work around VS2019 16.4.0 bug
|
||||
std::scoped_lock<wpi::mutex> lock(m_mutex);
|
||||
#else
|
||||
std::scoped_lock lock(m_mutex);
|
||||
#endif
|
||||
|
||||
// Pretty typical set of video modes
|
||||
m_videoModes.clear();
|
||||
|
||||
@@ -78,7 +78,11 @@ template <typename THandle, typename TStruct, int typeValue, typename TMutex>
|
||||
template <typename... Args>
|
||||
THandle UnlimitedHandleResource<THandle, TStruct, typeValue, TMutex>::Allocate(
|
||||
Args&&... args) {
|
||||
#ifdef _MSC_VER // work around VS2019 16.4.0 bug
|
||||
std::scoped_lock<TMutex> lock(m_handleMutex);
|
||||
#else
|
||||
std::scoped_lock sync(m_handleMutex);
|
||||
#endif
|
||||
size_t i;
|
||||
for (i = 0; i < m_structures.size(); i++) {
|
||||
if (m_structures[i] == nullptr) {
|
||||
|
||||
@@ -74,7 +74,11 @@ class SimCallbackRegistry : public impl::SimCallbackRegistryBase {
|
||||
|
||||
template <typename... U>
|
||||
void Invoke(U&&... u) const {
|
||||
#ifdef _MSC_VER // work around VS2019 16.4.0 bug
|
||||
std::scoped_lock<wpi::recursive_spinlock> lock(m_mutex);
|
||||
#else
|
||||
std::scoped_lock lock(m_mutex);
|
||||
#endif
|
||||
if (m_callbacks) {
|
||||
const char* name = GetName();
|
||||
for (auto&& cb : *m_callbacks)
|
||||
|
||||
@@ -10,7 +10,7 @@ nativeUtils {
|
||||
wpiVersion = "-1"
|
||||
niLibVersion = "2020.9.1"
|
||||
opencvVersion = "3.4.7-2"
|
||||
googleTestVersion = "1.9.0-3-437e100"
|
||||
googleTestVersion = "1.9.0-4-437e100-1"
|
||||
imguiVersion = "1.72b-2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user