summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-02-11 18:40:27 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-02-11 20:21:35 +0100
commit24f8f904f3975832b77e18957dc41d2372deebc5 (patch)
treed6097eec1bd3118487d044dec3d8f28b7e0ac147
parent15a8ad060653a521bcd175b495455a0e09377050 (diff)
less header namespace pollution
-rw-r--r--compat/simple-mat.hpp18
-rw-r--r--options/value.cpp3
-rw-r--r--options/value.hpp37
3 files changed, 28 insertions, 30 deletions
diff --git a/compat/simple-mat.hpp b/compat/simple-mat.hpp
index 87e1ae83..d42a2fe8 100644
--- a/compat/simple-mat.hpp
+++ b/compat/simple-mat.hpp
@@ -79,33 +79,32 @@ public:
template<int P = h_> std::enable_if_t<equals<P, 1, 3>::value, num&>
constexpr inline operator()(unsigned i) & { return data[0][i]; }
-#define OPENTRACK_ASSERT_SWIZZLE static_assert(P == h_ && Q == w_)
+#define OTR_MAT_ASSERT_SWIZZLE static_assert(P == h_ && Q == w_)
// const variants
template<int P = h_, int Q = w_> std::enable_if_t<maybe_add_swizzle<P, Q, 1, 4>::value, num>
- constexpr inline x() const& { OPENTRACK_ASSERT_SWIZZLE; return operator()(0); }
+ constexpr inline x() const& { OTR_MAT_ASSERT_SWIZZLE; return operator()(0); }
template<int P = h_, int Q = w_> std::enable_if_t<maybe_add_swizzle<P, Q, 2, 4>::value, num>
- constexpr inline y() const& { OPENTRACK_ASSERT_SWIZZLE; return operator()(1); }
+ constexpr inline y() const& { OTR_MAT_ASSERT_SWIZZLE; return operator()(1); }
template<int P = h_, int Q = w_> std::enable_if_t<maybe_add_swizzle<P, Q, 3, 4>::value, num>
- constexpr inline z() const& { OPENTRACK_ASSERT_SWIZZLE; return operator()(2); }
+ constexpr inline z() const& { OTR_MAT_ASSERT_SWIZZLE; return operator()(2); }
template<int P = h_, int Q = w_> std::enable_if_t<maybe_add_swizzle<P, Q, 4, 4>::value, num>
- constexpr inline w() const& { OPENTRACK_ASSERT_SWIZZLE; return operator()(3); }
+ constexpr inline w() const& { OTR_MAT_ASSERT_SWIZZLE; return operator()(3); }
// mutable variants
template<int P = h_, int Q = w_> std::enable_if_t<maybe_add_swizzle<P, Q, 1, 4>::value, num&>
- constexpr inline x() & { OPENTRACK_ASSERT_SWIZZLE; return operator()(0); }
+ constexpr inline x() & { OTR_MAT_ASSERT_SWIZZLE; return operator()(0); }
template<int P = h_, int Q = w_> std::enable_if_t<maybe_add_swizzle<P, Q, 2, 4>::value, num&>
- constexpr inline y() & { OPENTRACK_ASSERT_SWIZZLE; return operator()(1); }
+ constexpr inline y() & { OTR_MAT_ASSERT_SWIZZLE; return operator()(1); }
template<int P = h_, int Q = w_> std::enable_if_t<maybe_add_swizzle<P, Q, 3, 4>::value, num&>
- constexpr inline z() & { OPENTRACK_ASSERT_SWIZZLE; return operator()(2); }
+ constexpr inline z() & { OTR_MAT_ASSERT_SWIZZLE; return operator()(2); }
template<int P = h_, int Q = w_> std::enable_if_t<maybe_add_swizzle<P, Q, 4, 4>::value, num&>
- constexpr inline w() & { OPENTRACK_ASSERT_SWIZZLE; return operator()(3); }
template<int h_pos, int w_pos>
constexpr Mat<num, h_ - h_pos, w_ - w_pos> slice() const
@@ -119,6 +118,7 @@ public:
template<int off> std::enable_if_t<!equals<h_, 1, 2>::value && equals<w_, 1, 1>::value,
Mat<num, h_ - off, 1>>
slice() const { return ((double const*)*this) + off; }
+ constexpr inline w() & { OTR_MAT_ASSERT_SWIZZLE; return operator()(3); }
template<int P = h_, int Q = w_>
std::enable_if_t<is_vector<P, Q>::value, num>
diff --git a/options/value.cpp b/options/value.cpp
index e0be69ae..81a094e6 100644
--- a/options/value.cpp
+++ b/options/value.cpp
@@ -1,6 +1,5 @@
// instantiate the "template class" value<t> symbols
-#include "compat/linkage-macros.hpp"
-#define OTR_INST_VALUE(x) OTR_TEMPLATE_EXPORT(x)
+#define OTR_OPTIONS_INST_VALUE OTR_TEMPLATE_EXPORT
#include "value.hpp"
diff --git a/options/value.hpp b/options/value.hpp
index 18a5ae9b..940e2a15 100644
--- a/options/value.hpp
+++ b/options/value.hpp
@@ -153,26 +153,25 @@ public:
}
};
-// some linker problems
-#if !defined OTR_INST_VALUE
-# define OTR_INST_VALUE OTR_TEMPLATE_IMPORT
+#if !defined OTR_OPTIONS_INST_VALUE
+# define OTR_OPTIONS_INST_VALUE OTR_TEMPLATE_IMPORT
#endif
-OTR_INST_VALUE(value<double>)
-OTR_INST_VALUE(value<float>)
-OTR_INST_VALUE(value<int>)
-OTR_INST_VALUE(value<bool>)
-OTR_INST_VALUE(value<QString>)
-OTR_INST_VALUE(value<slider_value>)
-OTR_INST_VALUE(value<QPointF>)
-OTR_INST_VALUE(value<QVariant>)
-OTR_INST_VALUE(value<QList<double>>)
-OTR_INST_VALUE(value<QList<float>>)
-OTR_INST_VALUE(value<QList<int>>)
-OTR_INST_VALUE(value<QList<bool>>)
-OTR_INST_VALUE(value<QList<QString>>)
-OTR_INST_VALUE(value<QList<slider_value>>)
-OTR_INST_VALUE(value<QList<QPointF>>)
-OTR_INST_VALUE(value<QList<QVariant>>)
+OTR_OPTIONS_INST_VALUE(value<double>)
+OTR_OPTIONS_INST_VALUE(value<float>)
+OTR_OPTIONS_INST_VALUE(value<int>)
+OTR_OPTIONS_INST_VALUE(value<bool>)
+OTR_OPTIONS_INST_VALUE(value<QString>)
+OTR_OPTIONS_INST_VALUE(value<slider_value>)
+OTR_OPTIONS_INST_VALUE(value<QPointF>)
+OTR_OPTIONS_INST_VALUE(value<QVariant>)
+OTR_OPTIONS_INST_VALUE(value<QList<double>>)
+OTR_OPTIONS_INST_VALUE(value<QList<float>>)
+OTR_OPTIONS_INST_VALUE(value<QList<int>>)
+OTR_OPTIONS_INST_VALUE(value<QList<bool>>)
+OTR_OPTIONS_INST_VALUE(value<QList<QString>>)
+OTR_OPTIONS_INST_VALUE(value<QList<slider_value>>)
+OTR_OPTIONS_INST_VALUE(value<QList<QPointF>>)
+OTR_OPTIONS_INST_VALUE(value<QList<QVariant>>)
} // ns options