summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-05-03 14:54:09 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-05-03 14:54:09 +0200
commita42d3b16dd94aa3d2703431d72fdf995e5a92299 (patch)
tree9e5fe05e5a47184f2dba329aa38cbf007cc2d06c
parenta1fd815088ad6a98b580109f91ba8929453fca56 (diff)
tracker/steamvr: fix GNU libc typedef conflict
Really sometimes they should be less intrusive. Reported-by: @zanoni-mbdyn Issue: #771
-rw-r--r--tracker-steamvr/steamvr.cpp16
-rw-r--r--tracker-steamvr/steamvr.hpp8
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<typename F>
-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<device_spec>& 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<vr_t, error_t>;
+using tt = std::tuple<vr_t, vr_error_t>;
using pose_t = vr::TrackedDevicePose_t;
using origin = vr::ETrackingUniverseOrigin;
@@ -55,11 +55,11 @@ struct device_list final
const QList<device_spec>& 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<typename F>
- 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_spec> device_specs;