Skip to content

Commit

Permalink
[cscore,hal] Remove VS 2019 16.4.0 workaround (wpilibsuite#7201)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 authored Oct 12, 2024
1 parent f23bece commit 1288501
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 16 deletions.
4 changes: 0 additions & 4 deletions cscore/src/main/native/cpp/HttpCameraImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,7 @@ 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();
Expand Down
4 changes: 0 additions & 4 deletions cscore/src/main/native/cpp/UnlimitedHandleResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ 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) {
Expand Down
4 changes: 0 additions & 4 deletions hal/src/main/native/sim/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ class SimPeriodicCallbackRegistry : public impl::SimCallbackRegistryBase {
}

void operator()() 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) {
for (auto&& cb : *m_callbacks) {
reinterpret_cast<HALSIM_SimPeriodicCallback>(cb.callback)(cb.param);
Expand Down

0 comments on commit 1288501

Please sign in to comment.