From a42d3b16dd94aa3d2703431d72fdf995e5a92299 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 3 May 2018 14:54:09 +0200 Subject: tracker/steamvr: fix GNU libc typedef conflict Really sometimes they should be less intrusive. Reported-by: @zanoni-mbdyn Issue: #771 --- tracker-steamvr/steamvr.cpp | 16 ++++++++-------- tracker-steamvr/steamvr.hpp | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp index 32cb6ed1..fd21187b 100644 --- a/tracker-steamvr/steamvr.cpp +++ b/tracker-steamvr/steamvr.cpp @@ -31,17 +31,17 @@ QMutex device_list::mtx(QMutex::Recursive); template -auto with_vr_lock(F&& fun) -> decltype(fun(vr_t(), error_t())) +auto with_vr_lock(F&& fun) -> decltype(fun(vr_t(), vr_error_t())) { QMutexLocker l(&device_list::mtx); - error_t e; vr_t v; + vr_error_t e; vr_t v; std::tie(v, e) = device_list::vr_init(); return fun(v, e); } void device_list::fill_device_specs(QList& list) { - with_vr_lock([&](vr_t v, error_t) + with_vr_lock([&](vr_t v, vr_error_t) { list.clear(); @@ -129,7 +129,7 @@ device_list::maybe_pose device_list::get_pose(int k) if (k < 0 || !(k < max_devices)) return maybe_pose(false, pose_t{}); - return with_vr_lock([k](vr_t v, error_t) + return with_vr_lock([k](vr_t v, vr_error_t) { static pose_t poses[max_devices] {}; // vr_lock removes reentrancy @@ -158,7 +158,7 @@ tt device_list::vr_init() tt device_list::vr_init_() { - error_t error = error_t::VRInitError_Unknown; + vr_error_t error = vr_error_t::VRInitError_Unknown; vr_t v = vr::VR_Init(&error, vr::EVRApplicationType::VRApplication_Other); if (v) @@ -169,7 +169,7 @@ tt device_list::vr_init_() return tt(v, error); } -QString device_list::strerror(error_t err) +QString device_list::strerror(vr_error_t err) { const char* str(vr::VR_GetVRInitErrorAsSymbol(err)); return QString(str ? str : "No description"); @@ -185,7 +185,7 @@ steamvr::~steamvr() module_status steamvr::start_tracker(QFrame*) { - return with_vr_lock([this](vr_t v, error_t e) + return with_vr_lock([this](vr_t v, vr_error_t e) { QString err; @@ -250,7 +250,7 @@ void steamvr::data(double* data) bool steamvr::center() { - return with_vr_lock([&](vr_t v, error_t) + return with_vr_lock([&](vr_t v, vr_error_t) { if (v) { diff --git a/tracker-steamvr/steamvr.hpp b/tracker-steamvr/steamvr.hpp index 4ae52371..73964593 100644 --- a/tracker-steamvr/steamvr.hpp +++ b/tracker-steamvr/steamvr.hpp @@ -21,10 +21,10 @@ using namespace options; using rmat = euler::rmat; using euler_t = euler::euler_t; -using error_t = vr::EVRInitError; +using vr_error_t = vr::EVRInitError; using vr_t = vr::IVRSystem*; -using tt = std::tuple; +using tt = std::tuple; using pose_t = vr::TrackedDevicePose_t; using origin = vr::ETrackingUniverseOrigin; @@ -55,11 +55,11 @@ struct device_list final const QList& devices() const { return device_specs; } static never_inline maybe_pose get_pose(int k); - static QString strerror(error_t error); + static QString strerror(vr_error_t error); static constexpr inline unsigned max_devices = vr::k_unMaxTrackedDeviceCount; template - friend auto with_vr_lock(F&& fun) -> decltype(fun(vr_t(), error_t())); + friend auto with_vr_lock(F&& fun) -> decltype(fun(vr_t(), vr_error_t())); private: QList device_specs; -- cgit v1.2.3