diff options
-rw-r--r-- | compat/clamp.hpp | 54 | ||||
-rw-r--r-- | compat/functional.hpp | 87 | ||||
-rw-r--r-- | compat/macros.hpp | 5 | ||||
-rw-r--r-- | compat/meta.hpp | 8 | ||||
-rw-r--r-- | compat/ndebug-guard.hpp | 5 | ||||
-rw-r--r-- | compat/round.hpp | 15 | ||||
-rw-r--r-- | compat/run-in-thread.hpp | 5 | ||||
-rw-r--r-- | compat/time.hpp | 2 | ||||
-rw-r--r-- | compat/timer.cpp | 1 | ||||
-rw-r--r-- | compat/util.hpp | 82 | ||||
-rw-r--r-- | compat/value-templates.hpp | 192 | ||||
-rw-r--r-- | options/options.hpp | 2 | ||||
-rw-r--r-- | options/value-traits.hpp | 3 | ||||
-rw-r--r-- | proto-ft/ftnoir_protocol_ft.cpp | 3 | ||||
-rw-r--r-- | proto-libevdev/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tracker-fusion/fusion.cpp | 1 | ||||
-rw-r--r-- | tracker-pt/camera.h | 1 |
17 files changed, 90 insertions, 377 deletions
diff --git a/compat/clamp.hpp b/compat/clamp.hpp new file mode 100644 index 00000000..8141e25f --- /dev/null +++ b/compat/clamp.hpp @@ -0,0 +1,54 @@ +#pragma once + +#include <cmath> +#include <type_traits> + +#include "macros.hpp" + +namespace util_detail { + +template<typename n> +inline auto clamp_float(n val, n min_, n max_) +{ + return std::fmin(std::fmax(val, min_), max_); +} + +template<typename t, typename n> +struct clamp final +{ + static inline auto clamp_(const n& val, const n& min_, const n& max_) + { + if (unlikely(val > max_)) + return max_; + if (unlikely(val < min_)) + return min_; + return val; + } +}; + +template<typename t> +struct clamp<float, t> +{ + static inline auto clamp_(float val, float min_, float max_) + { + return clamp_float(val, min_, max_); + } +}; + +template<typename t> +struct clamp<double, t> +{ + static inline auto clamp_(double val, double min_, double max_) + { + return clamp_float(val, min_, max_); + } +}; + +} // ns util_detail + +template<typename t, typename u, typename w> +inline auto clamp(const t& val, const u& min, const w& max) +{ + using tp = decltype(val + min + max); + return ::util_detail::clamp<std::decay_t<tp>, tp>::clamp_(val, min, max); +} diff --git a/compat/functional.hpp b/compat/functional.hpp deleted file mode 100644 index dcba0538..00000000 --- a/compat/functional.hpp +++ /dev/null @@ -1,87 +0,0 @@ -#pragma once - -#include "value-templates.hpp" - -#include <algorithm> -#include <iterator> -#include <type_traits> -#include <vector> - -namespace functools -{ - -template<typename seq_, typename = void> -struct reserver_ -{ - static inline void maybe_reserve_space(seq_&, unsigned) - { - //qDebug() << "nada"; - } -}; - -template<typename seq_> -struct reserver_<seq_, decltype(std::declval<seq_>().reserve(0u), (void)0)> -{ - static inline void maybe_reserve_space(seq_& seq, unsigned sz) - { - seq.reserve(sz); - } -}; - -template<typename seq_> -inline void maybe_reserve_space(seq_& seq, unsigned sz) -{ - reserver_<seq_, void>::maybe_reserve_space(seq, sz); -} - -} // ns - -template<typename t, t value_> -struct constant final -{ - using type = t; - constexpr type operator()() const noexcept - { - return value_; - } - static constexpr type value = value_; - - constant() = delete; -}; - -template<typename seq_, typename F> -auto map(F&& fun, const seq_& seq) -{ - using value_type = std::decay_t<typename std::iterator_traits<decltype(std::begin(seq))>::value_type>; - using ret_type = std::decay_t<decltype(fun(std::declval<value_type>()))>; - - std::vector<ret_type> ret; - auto it = std::back_inserter(ret); - - for (const auto& elt : seq) - it = fun(elt); - - return ret; -} - -template<typename seq_, typename F> -auto remove_if_not(F&& fun, const seq_& seq) -{ - using namespace functools; - - using seq_type = std::decay_t<seq_>; - using value_type = std::decay_t<typename std::iterator_traits<decltype(std::begin(seq))>::value_type>; - using fun_ret_type = decltype(fun(std::declval<value_type>())); - static_assert(is_convertible_v<fun_ret_type, bool>, "must return bool"); - - seq_type ret; - maybe_reserve_space(ret, seq.size()); - - std::back_insert_iterator<seq_type> it = std::back_inserter(ret); - - for (const value_type& elt : seq) - if (fun(elt)) - it = elt; - - return ret; -} diff --git a/compat/macros.hpp b/compat/macros.hpp index e3b5976a..d51bace7 100644 --- a/compat/macros.hpp +++ b/compat/macros.hpp @@ -70,3 +70,8 @@ # define likely(x) (x) # define unlikely(x) (x) #endif + +#define progn(...) (([&]() { __VA_ARGS__ })()) +#define prog1(x, ...) (([&]() { auto _ret1324 = (x); do { __VA_ARGS__; } while (0); return _ret1324; })()) + +#define once_only(...) do { static bool once__ = false; if (!once__) { once__ = true; __VA_ARGS__; } } while(false) diff --git a/compat/meta.hpp b/compat/meta.hpp index e4c49ef6..ce81b3d0 100644 --- a/compat/meta.hpp +++ b/compat/meta.hpp @@ -8,6 +8,12 @@ */ #include <type_traits> + +template<typename t> +using cv_qualified = std::conditional_t<std::is_fundamental_v<std::decay_t<t>>, std::decay_t<t>, const t&>; + +#if 0 + #include <tuple> #include <cstddef> @@ -76,3 +82,5 @@ template<std::size_t max> using index_sequence = typename detail::index_sequence_<std::size_t, max, std::size_t(0)>::type; } // ns meta + +#endif diff --git a/compat/ndebug-guard.hpp b/compat/ndebug-guard.hpp deleted file mode 100644 index e38fd0fe..00000000 --- a/compat/ndebug-guard.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef NDEBUG -# error "NDEBUG defined, don't define it" -#endif - -#include <cassert> diff --git a/compat/round.hpp b/compat/round.hpp new file mode 100644 index 00000000..90a0ccb3 --- /dev/null +++ b/compat/round.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include <cmath> + +template<typename t> +inline int iround(const t& val) +{ + return int(std::round(val)); +} + +template<typename t> +inline unsigned uround(const t& val) +{ + return std::round(std::fmax(t(0), val)); +} diff --git a/compat/run-in-thread.hpp b/compat/run-in-thread.hpp index 67f4b1f5..c2243fc3 100644 --- a/compat/run-in-thread.hpp +++ b/compat/run-in-thread.hpp @@ -7,7 +7,7 @@ * copyright notice and this permission notice appear in all copies. */ -#include "ndebug-guard.hpp" +#include "macros.hpp" #include <cassert> #include <thread> @@ -53,7 +53,8 @@ struct run_in_thread_traits<void> } template<typename F> -auto run_in_thread_sync(QObject* obj, F&& fun) +auto never_inline +run_in_thread_sync(QObject* obj, F&& fun) -> typename qt_impl_detail::run_in_thread_traits<decltype(std::forward<F>(fun)())>::ret_type { using lock_guard = std::unique_lock<std::mutex>; diff --git a/compat/time.hpp b/compat/time.hpp index e65e4855..d34e4e8c 100644 --- a/compat/time.hpp +++ b/compat/time.hpp @@ -1,7 +1,5 @@ #pragma once -#include "compat/functional.hpp" - #include <chrono> namespace time_units { diff --git a/compat/timer.cpp b/compat/timer.cpp index ff08c3d5..a3d91af4 100644 --- a/compat/timer.cpp +++ b/compat/timer.cpp @@ -6,7 +6,6 @@ * notice appear in all copies. */ -#include "ndebug-guard.hpp" #include <cassert> #include "timer.hpp" diff --git a/compat/util.hpp b/compat/util.hpp index a1976e35..dda947e5 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -1,88 +1,10 @@ #pragma once #include "opentrack-library-path.h" -#include "ndebug-guard.hpp" #include "run-in-thread.hpp" #include "meta.hpp" -#include "functional.hpp" #include "macros.hpp" -#include "value-templates.hpp" - -#include <type_traits> -#include <memory> -#include <cmath> -#include <utility> - -#include <iterator> +#include "round.hpp" +#include "clamp.hpp" #include <QDebug> - -#define progn(...) (([&]() { __VA_ARGS__ })()) -#define prog1(x, ...) (([&]() { auto _ret1324 = (x); do { __VA_ARGS__; } while (0); return _ret1324; })()) - -#define once_only(...) do { static bool once = false; if (!once) { once = true; __VA_ARGS__; } } while(false) - -template<typename t> -inline int iround(const t& val) -{ - return int(std::round(val)); -} - -template<typename t> -inline unsigned uround(const t& val) -{ - return std::round(std::fmax(t(0), val)); -} - -namespace util_detail { - -template<typename n> -inline auto clamp_float(n val, n min_, n max_) -{ - return std::fmin(std::fmax(val, min_), max_); -} - -template<typename t, typename n> -struct clamp final -{ - static inline auto clamp_(const n& val, const n& min_, const n& max_) - { - if (unlikely(val > max_)) - return max_; - if (unlikely(val < min_)) - return min_; - return val; - } -}; - -template<typename t> -struct clamp<float, t> -{ - static inline auto clamp_(float val, float min_, float max_) - { - return clamp_float(val, min_, max_); - } -}; - -template<typename t> -struct clamp<double, t> -{ - static inline auto clamp_(double val, double min_, double max_) - { - return clamp_float(val, min_, max_); - } -}; - -} // ns util_detail - -template<typename t, typename u, typename w> -inline auto clamp(const t& val, const u& min, const w& max) -{ - using tp = decltype(val + min + max); - return ::util_detail::clamp<std::decay_t<tp>, tp>::clamp_(val, min, max); -} - -template<typename t> -using cv_qualified = std::conditional_t<is_fundamental_v<std::decay_t<t>>, std::decay_t<t>, const t&>; - - diff --git a/compat/value-templates.hpp b/compat/value-templates.hpp deleted file mode 100644 index 0764b1ab..00000000 --- a/compat/value-templates.hpp +++ /dev/null @@ -1,192 +0,0 @@ -#pragma once - -#include <type_traits> -#include <memory> -#include <functional> -#include <system_error> -#include <chrono> -#include <ratio> - -#if __cplusplus < 201703L - -template <class T> constexpr bool is_void_v = std::is_void<T>::value; -template <class T> constexpr bool is_null_pointer_v = std::is_null_pointer<T>::value; -template <class T> constexpr bool is_integral_v = std::is_integral<T>::value; -template <class T> constexpr bool is_floating_point_v = std::is_floating_point<T>::value; -template <class T> constexpr bool is_array_v = std::is_array<T>::value; -template <class T> constexpr bool is_pointer_v = std::is_pointer<T>::value; -template <class T> constexpr bool is_lvalue_reference_v = std::is_lvalue_reference<T>::value; -template <class T> constexpr bool is_rvalue_reference_v = std::is_rvalue_reference<T>::value; -template <class T> constexpr bool is_member_object_pointer_v = std::is_member_object_pointer<T>::value; -template <class T> constexpr bool is_member_function_pointer_v = std::is_member_function_pointer<T>::value; -template <class T> constexpr bool is_enum_v = std::is_enum<T>::value; -template <class T> constexpr bool is_union_v = std::is_union<T>::value; -template <class T> constexpr bool is_class_v = std::is_class<T>::value; -template <class T> constexpr bool is_function_v = std::is_function<T>::value; - -template <class T> constexpr bool is_reference_v = std::is_reference<T>::value; -template <class T> constexpr bool is_arithmetic_v = std::is_arithmetic<T>::value; -template <class T> constexpr bool is_fundamental_v = std::is_fundamental<T>::value; -template <class T> constexpr bool is_object_v = std::is_object<T>::value; -template <class T> constexpr bool is_scalar_v = std::is_scalar<T>::value; -template <class T> constexpr bool is_compound_v = std::is_compound<T>::value; -template <class T> constexpr bool is_member_pointer_v = std::is_member_pointer<T>::value; - -template <class T> constexpr bool is_const_v = std::is_const<T>::value; -template <class T> constexpr bool is_volatile_v = std::is_volatile<T>::value; -template <class T> constexpr bool is_trivial_v = std::is_trivial<T>::value; -template <class T> constexpr bool is_trivially_copyable_v = std::is_trivially_copyable<T>::value; -template <class T> constexpr bool is_standard_layout_v = std::is_standard_layout<T>::value; -template <class T> constexpr bool is_pod_v = std::is_pod<T>::value; -template <class T> constexpr bool is_literal_type_v = std::is_literal_type<T>::value; -template <class T> constexpr bool is_empty_v = std::is_empty<T>::value; -template <class T> constexpr bool is_polymorphic_v = std::is_polymorphic<T>::value; -template <class T> constexpr bool is_abstract_v = std::is_abstract<T>::value; -template <class T> constexpr bool is_final_v = std::is_final<T>::value; -template <class T> constexpr bool is_signed_v = std::is_signed<T>::value; -template <class T> constexpr bool is_unsigned_v = std::is_unsigned<T>::value; - -template <class T, class... Args> constexpr bool is_constructible_v = std::is_constructible<T, Args...>::value; -template <class T, class... Args> constexpr bool is_trivially_constructible_v = std::is_trivially_constructible<T, Args...>::value; -template <class T, class... Args> constexpr bool is_nothrow_constructible_v = std::is_nothrow_constructible<T, Args...>::value; -template <class T> constexpr bool is_default_constructible_v = std::is_default_constructible<T>::value; -template <class T> constexpr bool is_trivially_default_constructible_v = std::is_trivially_default_constructible<T>::value; -template <class T> constexpr bool is_nothrow_default_constructible_v = std::is_nothrow_default_constructible<T>::value; -template <class T> constexpr bool is_copy_constructible_v = std::is_copy_constructible<T>::value; -template <class T> constexpr bool is_trivially_copy_constructible_v = std::is_trivially_copy_constructible<T>::value; -template <class T> constexpr bool is_nothrow_copy_constructible_v = std::is_nothrow_copy_constructible<T>::value; -template <class T> constexpr bool is_move_constructible_v = std::is_move_constructible<T>::value; -template <class T> constexpr bool is_trivially_move_constructible_v = std::is_trivially_move_constructible<T>::value; -template <class T> constexpr bool is_nothrow_move_constructible_v = std::is_nothrow_move_constructible<T>::value; -template <class T, class U> constexpr bool is_assignable_v = std::is_assignable<T, U>::value; -template <class T, class U> constexpr bool is_trivially_assignable_v = std::is_trivially_assignable<T, U>::value; -template <class T, class U> constexpr bool is_nothrow_assignable_v = std::is_nothrow_assignable<T, U>::value; -template <class T> constexpr bool is_copy_assignable_v = std::is_copy_assignable<T>::value; -template <class T> constexpr bool is_trivially_copy_assignable_v = std::is_trivially_copy_assignable<T>::value; -template <class T> constexpr bool is_nothrow_copy_assignable_v = std::is_nothrow_copy_assignable<T>::value; -template <class T> constexpr bool is_move_assignable_v = std::is_move_assignable<T>::value; -template <class T> constexpr bool is_trivially_move_assignable_v = std::is_trivially_move_assignable<T>::value; -template <class T> constexpr bool is_nothrow_move_assignable_v = std::is_nothrow_move_assignable<T>::value; -template <class T> constexpr bool is_destructible_v = std::is_destructible<T>::value; -template <class T> constexpr bool is_trivially_destructible_v = std::is_trivially_destructible<T>::value; -template <class T> constexpr bool is_nothrow_destructible_v = std::is_nothrow_destructible<T>::value; -template <class T> constexpr bool has_virtual_destructor_v = std::has_virtual_destructor<T>::value; - -template <class T> constexpr std::size_t alignment_of_v = std::alignment_of<T>::value; -template <class T> constexpr std::size_t rank_v = std::rank<T>::value; -template <class T, unsigned I = 0> constexpr std::size_t extent_v = std::extent<T, I>::value; - -template <class T, class U> constexpr bool is_same_v = std::is_same<T, U>::value; -template <class Base, class Derived> constexpr bool is_base_of_v = std::is_base_of<Base, Derived>::value; -template <class From, class To> constexpr bool is_convertible_v = std::is_convertible<From, To>::value; - -template <class R1, class R2> constexpr bool ratio_equal_v = std::ratio_equal<R1, R2>::value; -template <class R1, class R2> constexpr bool ratio_not_equal_v = std::ratio_not_equal<R1, R2>::value; -template <class R1, class R2> constexpr bool ratio_less_v = std::ratio_less<R1, R2>::value; -template <class R1, class R2> constexpr bool ratio_less_equal_v = std::ratio_less_equal<R1, R2>::value; -template <class R1, class R2> constexpr bool ratio_greater_v = std::ratio_greater<R1, R2>::value; -template <class R1, class R2> constexpr bool ratio_greater_equal_v = std::ratio_greater_equal<R1, R2>::value; - -template <class T> constexpr std::size_t tuple_size_v = std::tuple_size<T>::value; -template <class Rep> constexpr bool treat_as_floating_point_v = std::chrono::treat_as_floating_point<Rep>::value; - -template <class T> constexpr bool is_error_code_enum_v = std::is_error_code_enum<T>::value; -template <class T> constexpr bool is_error_condition_enum_v = std::is_error_condition_enum<T>::value; - -template <class T> constexpr bool is_bind_expression_v = std::is_bind_expression<T>::value; -template <class T> constexpr bool is_placeholder_v = std::is_placeholder<T>::value; - -template <class T, class Alloc> constexpr bool uses_allocator_v = std::uses_allocator<T, Alloc>::value; - -#else - -template <class T> constexpr bool is_void_v = std::is_void_v<T>; -template <class T> constexpr bool is_null_pointer_v = std::is_null_pointer_v<T>; -template <class T> constexpr bool is_integral_v = std::is_integral_v<T>; -template <class T> constexpr bool is_floating_point_v = std::is_floating_point_v<T>; -template <class T> constexpr bool is_array_v = std::is_array_v<T>; -template <class T> constexpr bool is_pointer_v = std::is_pointer_v<T>; -template <class T> constexpr bool is_lvalue_reference_v = std::is_lvalue_reference_v<T>; -template <class T> constexpr bool is_rvalue_reference_v = std::is_rvalue_reference_v<T>; -template <class T> constexpr bool is_member_object_pointer_v = std::is_member_object_pointer_v<T>; -template <class T> constexpr bool is_member_function_pointer_v = std::is_member_function_pointer_v<T>; -template <class T> constexpr bool is_enum_v = std::is_enum_v<T>; -template <class T> constexpr bool is_union_v = std::is_union_v<T>; -template <class T> constexpr bool is_class_v = std::is_class_v<T>; -template <class T> constexpr bool is_function_v = std::is_function_v<T>; - -template <class T> constexpr bool is_reference_v = std::is_reference_v<T>; -template <class T> constexpr bool is_arithmetic_v = std::is_arithmetic_v<T>; -template <class T> constexpr bool is_fundamental_v = std::is_fundamental_v<T>; -template <class T> constexpr bool is_object_v = std::is_object_v<T>; -template <class T> constexpr bool is_scalar_v = std::is_scalar_v<T>; -template <class T> constexpr bool is_compound_v = std::is_compound_v<T>; -template <class T> constexpr bool is_member_pointer_v = std::is_member_pointer_v<T>; - -template <class T> constexpr bool is_const_v = std::is_const_v<T>; -template <class T> constexpr bool is_volatile_v = std::is_volatile_v<T>; -template <class T> constexpr bool is_trivial_v = std::is_trivial_v<T>; -template <class T> constexpr bool is_trivially_copyable_v = std::is_trivially_copyable_v<T>; -template <class T> constexpr bool is_standard_layout_v = std::is_standard_layout_v<T>; -template <class T> constexpr bool is_pod_v = std::is_pod_v<T>; -template <class T> constexpr bool is_literal_type_v = std::is_literal_type_v<T>; -template <class T> constexpr bool is_empty_v = std::is_empty_v<T>; -template <class T> constexpr bool is_polymorphic_v = std::is_polymorphic_v<T>; -template <class T> constexpr bool is_abstract_v = std::is_abstract_v<T>; -template <class T> constexpr bool is_final_v = std::is_final_v<T>; -template <class T> constexpr bool is_signed_v = std::is_signed_v<T>; -template <class T> constexpr bool is_unsigned_v = std::is_unsigned_v<T>; - -template <class T, class... Args> constexpr bool is_constructible_v = std::is_constructible_v<T, Args...>; -template <class T, class... Args> constexpr bool is_trivially_constructible_v = std::is_trivially_constructible_v<T, Args...>; -template <class T, class... Args> constexpr bool is_nothrow_constructible_v = std::is_nothrow_constructible_v<T, Args...>; -template <class T> constexpr bool is_default_constructible_v = std::is_default_constructible_v<T>; -template <class T> constexpr bool is_trivially_default_constructible_v = std::is_trivially_default_constructible_v<T>; -template <class T> constexpr bool is_nothrow_default_constructible_v = std::is_nothrow_default_constructible_v<T>; -template <class T> constexpr bool is_copy_constructible_v = std::is_copy_constructible_v<T>; -template <class T> constexpr bool is_trivially_copy_constructible_v = std::is_trivially_copy_constructible_v<T>; -template <class T> constexpr bool is_nothrow_copy_constructible_v = std::is_nothrow_copy_constructible_v<T>; -template <class T> constexpr bool is_move_constructible_v = std::is_move_constructible_v<T>; -template <class T> constexpr bool is_trivially_move_constructible_v = std::is_trivially_move_constructible_v<T>; -template <class T> constexpr bool is_nothrow_move_constructible_v = std::is_nothrow_move_constructible_v<T>; -template <class T, class U> constexpr bool is_assignable_v = std::is_assignable_v<T, U>; -template <class T, class U> constexpr bool is_trivially_assignable_v = std::is_trivially_assignable_v<T, U>; -template <class T, class U> constexpr bool is_nothrow_assignable_v = std::is_nothrow_assignable_v<T, U>; -template <class T> constexpr bool is_copy_assignable_v = std::is_copy_assignable_v<T>; -template <class T> constexpr bool is_trivially_copy_assignable_v = std::is_trivially_copy_assignable_v<T>; -template <class T> constexpr bool is_nothrow_copy_assignable_v = std::is_nothrow_copy_assignable_v<T>; -template <class T> constexpr bool is_move_assignable_v = std::is_move_assignable_v<T>; -template <class T> constexpr bool is_trivially_move_assignable_v = std::is_trivially_move_assignable_v<T>; -template <class T> constexpr bool is_nothrow_move_assignable_v = std::is_nothrow_move_assignable_v<T>; -template <class T> constexpr bool is_destructible_v = std::is_destructible_v<T>; -template <class T> constexpr bool is_trivially_destructible_v = std::is_trivially_destructible_v<T>; -template <class T> constexpr bool is_nothrow_destructible_v = std::is_nothrow_destructible_v<T>; -template <class T> constexpr bool has_virtual_destructor_v = std::has_virtual_destructor_v<T>; - -template <class T> constexpr std::size_t alignment_of_v = std::alignment_of_v<T>; -template <class T> constexpr std::size_t rank_v = std::rank_v<T>; -template <class T, unsigned I = 0> constexpr std::size_t extent_v = std::extent_v<T, I>; - -template <class T, class U> constexpr bool is_same_v = std::is_same_v<T, U>; -template <class Base, class Derived> constexpr bool is_base_of_v = std::is_base_of_v<Base, Derived>; -template <class From, class To> constexpr bool is_convertible_v = std::is_convertible_v<From, To>; - -template <class R1, class R2> constexpr bool ratio_equal_v = std::ratio_equal_v<R1, R2>; -template <class R1, class R2> constexpr bool ratio_not_equal_v = std::ratio_not_equal_v<R1, R2>; -template <class R1, class R2> constexpr bool ratio_less_v = std::ratio_less_v<R1, R2>; -template <class R1, class R2> constexpr bool ratio_less_equal_v = std::ratio_less_equal_v<R1, R2>; -template <class R1, class R2> constexpr bool ratio_greater_v = std::ratio_greater_v<R1, R2>; -template <class R1, class R2> constexpr bool ratio_greater_equal_v = std::ratio_greater_equal_v<R1, R2>; - -template <class T> constexpr std::size_t tuple_size_v = std::tuple_size_v<T>; -template <class Rep> constexpr bool treat_as_floating_point_v = std::chrono::treat_as_floating_point_v<Rep>; - -template <class T> constexpr bool is_error_code_enum_v = std::is_error_code_enum_v<T>; -template <class T> constexpr bool is_error_condition_enum_v = std::is_error_condition_enum_v<T>; - -template <class T> constexpr bool is_bind_expression_v = std::is_bind_expression_v<T>; -template <class T> constexpr bool is_placeholder_v = std::is_placeholder_v<T>; - -template <class T, class Alloc> constexpr bool uses_allocator_v = std::uses_allocator_v<T, Alloc>; - -#endif diff --git a/options/options.hpp b/options/options.hpp index 0528b0d9..45697597 100644 --- a/options/options.hpp +++ b/options/options.hpp @@ -6,8 +6,6 @@ */ #pragma once -#include "compat/ndebug-guard.hpp" - #include "compat/util.hpp" #include "defs.hpp" diff --git a/options/value-traits.hpp b/options/value-traits.hpp index 3548c77a..ac5f6e5c 100644 --- a/options/value-traits.hpp +++ b/options/value-traits.hpp @@ -1,6 +1,5 @@ #include "export.hpp" -#include "compat/functional.hpp" #include "slider.hpp" #include <QString> @@ -37,7 +36,7 @@ struct value_traits<slider_value> : default_value_traits<slider_value> // Qt uses int a lot in slots so use it for all enums template<typename t> -struct value_traits<t, t, std::enable_if_t<is_enum_v<t>>> : public default_value_traits<int, t> +struct value_traits<t, t, std::enable_if_t<std::is_enum_v<t>>> : public default_value_traits<int, t> { }; diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp index 7fa34a84..04a5a4cf 100644 --- a/proto-ft/ftnoir_protocol_ft.cpp +++ b/proto-ft/ftnoir_protocol_ft.cpp @@ -6,17 +6,18 @@ * copyright notice and this permission notice appear in all copies. */ -#include "compat/ndebug-guard.hpp" #include "compat/util.hpp" #include "ftnoir_protocol_ft.h" #include "csv/csv.h" #include "opentrack-library-path.h" +#include <cassert> #include <cstddef> #include <atomic> #include <cmath> #include <cstdlib> + #include <windows.h> #include <intrin.h> diff --git a/proto-libevdev/CMakeLists.txt b/proto-libevdev/CMakeLists.txt index d6cd4560..412cca43 100644 --- a/proto-libevdev/CMakeLists.txt +++ b/proto-libevdev/CMakeLists.txt @@ -1,5 +1,4 @@ if(LINUX) - include(FindPkgConfig) pkg_check_modules(libevdev QUIET libevdev) if(libevdev_FOUND) otr_module(proto-libevdev) diff --git a/tracker-fusion/fusion.cpp b/tracker-fusion/fusion.cpp index 0b81b682..beeb7f53 100644 --- a/tracker-fusion/fusion.cpp +++ b/tracker-fusion/fusion.cpp @@ -6,7 +6,6 @@ * notice appear in all copies. */ -#include "compat/ndebug-guard.hpp" #include "fusion.h" #include "opentrack-library-path.h" diff --git a/tracker-pt/camera.h b/tracker-pt/camera.h index 030861c7..42eda9f5 100644 --- a/tracker-pt/camera.h +++ b/tracker-pt/camera.h @@ -7,7 +7,6 @@ #pragma once -#include "compat/ndebug-guard.hpp" #include "pt-api.hpp" #include "compat/util.hpp" |