summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--api/export.hpp29
-rw-r--r--api/plugin-api.hpp43
-rw-r--r--cmake/opentrack-boilerplate.cmake37
-rw-r--r--compat/camera-names.cpp4
-rw-r--r--compat/camera-names.hpp4
-rw-r--r--compat/euler.cpp6
-rw-r--r--compat/euler.hpp6
-rw-r--r--compat/export.hpp28
-rw-r--r--compat/linkage-macros.hpp15
-rw-r--r--compat/linkage.hpp11
-rw-r--r--compat/nan.cpp6
-rw-r--r--compat/nan.hpp6
-rw-r--r--compat/shm.h2
-rw-r--r--compat/timer.hpp2
-rw-r--r--csv/csv.h2
-rw-r--r--csv/export.hpp29
-rw-r--r--dinput/dinput.hpp2
-rw-r--r--dinput/export.hpp29
-rw-r--r--dinput/keybinding-worker.hpp4
-rw-r--r--dinput/win32-joystick.hpp4
-rw-r--r--logic/export.hpp29
-rw-r--r--logic/main-settings.hpp8
-rw-r--r--logic/mappings.hpp4
-rw-r--r--logic/selected-libraries.hpp2
-rw-r--r--logic/shortcuts.h2
-rw-r--r--logic/tracker.h2
-rw-r--r--logic/tracklogger.hpp4
-rw-r--r--logic/win32-shortcuts.h2
-rw-r--r--logic/work.hpp2
-rw-r--r--migration/export.hpp29
-rw-r--r--migration/migration.hpp4
-rw-r--r--options/bundle.cpp4
-rw-r--r--options/bundle.hpp12
-rw-r--r--options/export.hpp28
-rw-r--r--options/group.hpp2
-rw-r--r--options/scoped.hpp2
-rw-r--r--options/slider.hpp2
-rw-r--r--options/tie.cpp20
-rw-r--r--options/tie.hpp20
-rw-r--r--options/value.hpp2
-rw-r--r--pose-widget/glwidget.h2
-rw-r--r--spline/export.hpp28
-rw-r--r--spline/spline-widget.hpp2
-rw-r--r--spline/spline.hpp4
44 files changed, 184 insertions, 301 deletions
diff --git a/api/export.hpp b/api/export.hpp
index a9f3521e..59389bdf 100644
--- a/api/export.hpp
+++ b/api/export.hpp
@@ -1,28 +1,11 @@
-#pragma once
+// generates export.hpp for each module from compat/linkage.hpp
-#ifdef BUILD_api
-# ifdef _WIN32
-# define OPENTRACK_API_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_API_LINKAGE
-# endif
+#pragma once
-# ifndef _MSC_VER
-# define OPENTRACK_API_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_API_LINKAGE
-# else
-# define OPENTRACK_API_EXPORT OPENTRACK_API_LINKAGE
-# endif
+#include "compat/linkage-macros.hpp"
+#ifdef BUILD_API
+# define OTR_API_EXPORT OTR_GENERIC_EXPORT
#else
- #ifdef _WIN32
- # define OPENTRACK_API_LINKAGE __declspec(dllimport)
- #else
- # define OPENTRACK_API_LINKAGE
- #endif
-
- #ifndef _MSC_VER
- # define OPENTRACK_API_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_API_LINKAGE
- #else
- # define OPENTRACK_API_EXPORT OPENTRACK_API_LINKAGE
- #endif
+# define OTR_API_EXPORT OTR_GENERIC_IMPORT
#endif
diff --git a/api/plugin-api.hpp b/api/plugin-api.hpp
index 4c9dee2f..0588d3f8 100644
--- a/api/plugin-api.hpp
+++ b/api/plugin-api.hpp
@@ -17,19 +17,6 @@
#include "export.hpp"
-#ifndef OPENTRACK_PLUGIN_EXPORT
-# ifdef _WIN32
-# define OPENTRACK_PLUGIN_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_PLUGIN_LINKAGE
-# endif
-# ifndef _MSC_VER
-# define OPENTRACK_PLUGIN_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_PLUGIN_LINKAGE
-# else
-# define OPENTRACK_PLUGIN_EXPORT OPENTRACK_PLUGIN_LINKAGE
-# endif
-#endif
-
enum Axis {
TX = 0, TY = 1, TZ = 2, Yaw = 3, Pitch = 4, Roll = 5,
// for indexing in general
@@ -39,7 +26,7 @@ enum Axis {
namespace plugin_api {
namespace detail {
-class OPENTRACK_API_EXPORT BaseDialog : public QDialog
+class OTR_API_EXPORT BaseDialog : public QDialog
{
Q_OBJECT
protected:
@@ -55,27 +42,29 @@ private slots:
} // ns
} // ns
+#define OTR_PLUGIN_EXPORT OTR_GENERIC_EXPORT
+
#define OPENTRACK_DECLARE_PLUGIN_INTERNAL(ctor_class, ctor_ret_class, metadata_class, dialog_class, dialog_ret_class) \
- extern "C" OPENTRACK_PLUGIN_EXPORT ctor_ret_class* GetConstructor(); \
- extern "C" OPENTRACK_PLUGIN_EXPORT Metadata* GetMetadata(); \
- extern "C" OPENTRACK_PLUGIN_EXPORT dialog_ret_class* GetDialog(); \
+ extern "C" OTR_PLUGIN_EXPORT ctor_ret_class* GetConstructor(); \
+ extern "C" OTR_PLUGIN_EXPORT Metadata* GetMetadata(); \
+ extern "C" OTR_PLUGIN_EXPORT dialog_ret_class* GetDialog(); \
\
- extern "C" OPENTRACK_PLUGIN_EXPORT ctor_ret_class* GetConstructor() \
+ extern "C" OTR_PLUGIN_EXPORT ctor_ret_class* GetConstructor() \
{ \
return new ctor_class; \
} \
- extern "C" OPENTRACK_PLUGIN_EXPORT Metadata* GetMetadata() \
+ extern "C" OTR_PLUGIN_EXPORT Metadata* GetMetadata() \
{ \
return new metadata_class; \
} \
- extern "C" OPENTRACK_PLUGIN_EXPORT dialog_ret_class* GetDialog() \
+ extern "C" OTR_PLUGIN_EXPORT dialog_ret_class* GetDialog() \
{ \
return new dialog_class; \
}
// implement this in all plugins
// also you must link against "opentrack-api" in CMakeLists.txt to avoid vtable link errors
-struct OPENTRACK_API_EXPORT Metadata
+struct OTR_API_EXPORT Metadata
{
Metadata(const Metadata&) = delete;
Metadata(Metadata&&) = delete;
@@ -91,7 +80,7 @@ struct OPENTRACK_API_EXPORT Metadata
};
// implement this in filters
-struct OPENTRACK_API_EXPORT IFilter
+struct OTR_API_EXPORT IFilter
{
IFilter(const IFilter&) = delete;
IFilter(IFilter&&) = delete;
@@ -107,7 +96,7 @@ struct OPENTRACK_API_EXPORT IFilter
virtual void center() {}
};
-struct OPENTRACK_API_EXPORT IFilterDialog : public plugin_api::detail::BaseDialog
+struct OTR_API_EXPORT IFilterDialog : public plugin_api::detail::BaseDialog
{
IFilterDialog();
@@ -124,7 +113,7 @@ struct OPENTRACK_API_EXPORT IFilterDialog : public plugin_api::detail::BaseDialo
OPENTRACK_DECLARE_PLUGIN_INTERNAL(filter_class, IFilter, metadata_class, dialog_class, IFilterDialog)
// implement this in protocols
-struct OPENTRACK_API_EXPORT IProtocol
+struct OTR_API_EXPORT IProtocol
{
IProtocol();
@@ -143,7 +132,7 @@ struct OPENTRACK_API_EXPORT IProtocol
virtual QString game_name() = 0;
};
-struct OPENTRACK_API_EXPORT IProtocolDialog : public plugin_api::detail::BaseDialog
+struct OTR_API_EXPORT IProtocolDialog : public plugin_api::detail::BaseDialog
{
// optional destructor
virtual ~IProtocolDialog();
@@ -160,7 +149,7 @@ struct OPENTRACK_API_EXPORT IProtocolDialog : public plugin_api::detail::BaseDia
OPENTRACK_DECLARE_PLUGIN_INTERNAL(protocol_class, IProtocol, metadata_class, dialog_class, IProtocolDialog)
// implement this in trackers
-struct OPENTRACK_API_EXPORT ITracker
+struct OTR_API_EXPORT ITracker
{
ITracker(const ITracker&) = delete;
ITracker(ITracker&&) = delete;
@@ -178,7 +167,7 @@ struct OPENTRACK_API_EXPORT ITracker
virtual bool center() { return false; }
};
-struct OPENTRACK_API_EXPORT ITrackerDialog : public plugin_api::detail::BaseDialog
+struct OTR_API_EXPORT ITrackerDialog : public plugin_api::detail::BaseDialog
{
// optional destructor
virtual ~ITrackerDialog();
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 5661e151..0b8b83c0 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -113,6 +113,7 @@ function(otr_module n)
message(FATAL_ERROR "otr_module bad formals: ${arg_UNPARSED_ARGUMENTS}")
endif()
+ set(n_ "${n}")
set(n "opentrack-${n}")
project(${n})
@@ -179,7 +180,8 @@ function(otr_module n)
if(NOT arg_STATIC)
string(REGEX REPLACE "^opentrack-" "" n_ "${n}")
string(REPLACE "-" "_" n_ ${n_})
- target_compile_definitions(${n} PRIVATE "BUILD_${n_}")
+ string(TOUPPER "${n_}" n__)
+ target_compile_definitions(${n} PRIVATE "BUILD_${n__}")
if(NOT arg_NO-INSTALL)
if(arg_BIN AND WIN32)
@@ -191,37 +193,36 @@ function(otr_module n)
endif()
otr_install_pdb_current_project()
endif()
+ else()
+ target_compile_definitions(${n} PRIVATE "STATIC_LIBRARY=1")
endif()
set(langs "")
foreach(i ${opentrack-all-translations})
set(t "${CMAKE_CURRENT_SOURCE_DIR}/lang/${i}.ts")
-
list(APPEND langs "${t}")
-
- get_property(tt GLOBAL PROPERTY "opentrack-ts-${i}")
- list(APPEND tt "${t}")
- set_property(GLOBAL PROPERTY "opentrack-ts-${i}" "${tt}")
endforeach()
set_property(GLOBAL APPEND PROPERTY opentrack-all-modules "${n}")
- set(SDK_SKIP_TRANSLATION_UPDATE FALSE CACHE BOOL "Don't touch existing .ts files")
- set(langs_ "")
+ set(ts-deps)
foreach(i ${langs})
- if((NOT SDK_SKIP_TRANSLATION_UPDATE) OR (NOT EXISTS "${i}"))
- add_custom_command(OUTPUT "${i}"
- COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang"
- COMMAND "${Qt5_DIR}/../../../bin/lupdate" -silent -recursive -no-obsolete -locations relative . -ts "${i}"
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
- DEPENDS ${${n}-all}
- COMMENT "Running lupdate for ${i}")
- list(APPEND langs_ "${i}")
- endif()
+ set_property(GLOBAL PROPERTY "opentrack-ts-${i}" "")
+ add_custom_command(OUTPUT "${i}"
+ COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/lang"
+ COMMAND "${Qt5_DIR}/../../../bin/lupdate" -silent -recursive -no-obsolete -locations relative . -ts "${i}"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ DEPENDS ${${n}-c} ${${n}-rcc} ${${n}-uih}
+ COMMENT "Running lupdate for ${i}"
+ )
+ list(APPEND ts-deps "${i}")
+ get_property(tt GLOBAL PROPERTY "opentrack-ts-${i}")
+ list(APPEND tt "${i}")
+ set_property(GLOBAL PROPERTY "opentrack-ts-${i}" "${tt}")
endforeach()
- add_custom_target(i18n-module-${n} DEPENDS ${langs_})
+ add_custom_target(i18n-module-${n} DEPENDS ${ts-deps})
if(NOT arg_NO-INSTALL)
set_property(GLOBAL APPEND PROPERTY opentrack-all-source-dirs "${CMAKE_CURRENT_SOURCE_DIR}")
diff --git a/compat/camera-names.cpp b/compat/camera-names.cpp
index add8c094..22dcdd8f 100644
--- a/compat/camera-names.cpp
+++ b/compat/camera-names.cpp
@@ -17,7 +17,7 @@
#include <QDebug>
-OPENTRACK_COMPAT_EXPORT int camera_name_to_index(const QString &name)
+OTR_COMPAT_EXPORT int camera_name_to_index(const QString &name)
{
auto list = get_camera_names();
int ret = list.indexOf(name);
@@ -26,7 +26,7 @@ OPENTRACK_COMPAT_EXPORT int camera_name_to_index(const QString &name)
return ret;
}
-OPENTRACK_COMPAT_EXPORT QList<QString> get_camera_names()
+OTR_COMPAT_EXPORT QList<QString> get_camera_names()
{
QList<QString> ret;
#if defined(_WIN32)
diff --git a/compat/camera-names.hpp b/compat/camera-names.hpp
index ae0c6b25..97184c8c 100644
--- a/compat/camera-names.hpp
+++ b/compat/camera-names.hpp
@@ -13,6 +13,6 @@
#include "export.hpp"
-OPENTRACK_COMPAT_EXPORT QList<QString> get_camera_names();
-OPENTRACK_COMPAT_EXPORT int camera_name_to_index(const QString &name);
+OTR_COMPAT_EXPORT QList<QString> get_camera_names();
+OTR_COMPAT_EXPORT int camera_name_to_index(const QString &name);
diff --git a/compat/euler.cpp b/compat/euler.cpp
index a1034bc9..ab119d3e 100644
--- a/compat/euler.cpp
+++ b/compat/euler.cpp
@@ -3,7 +3,7 @@
namespace euler {
-euler_t OPENTRACK_COMPAT_EXPORT rmat_to_euler(const rmat& R)
+euler_t OTR_COMPAT_EXPORT rmat_to_euler(const rmat& R)
{
using std::atan2;
using std::sqrt;
@@ -21,7 +21,7 @@ euler_t OPENTRACK_COMPAT_EXPORT rmat_to_euler(const rmat& R)
}
// tait-bryan angles, not euler
-rmat OPENTRACK_COMPAT_EXPORT euler_to_rmat(const euler_t& input)
+rmat OTR_COMPAT_EXPORT euler_to_rmat(const euler_t& input)
{
const double H = -input(0);
const double P = -input(1);
@@ -54,7 +54,7 @@ rmat OPENTRACK_COMPAT_EXPORT euler_to_rmat(const euler_t& input)
}
// https://en.wikipedia.org/wiki/Davenport_chained_rotations#Tait.E2.80.93Bryan_chained_rotations
-void OPENTRACK_COMPAT_EXPORT tait_bryan_to_matrices(const euler_t& input,
+void OTR_COMPAT_EXPORT tait_bryan_to_matrices(const euler_t& input,
rmat& r_roll,
rmat& r_pitch,
rmat& r_yaw)
diff --git a/compat/euler.hpp b/compat/euler.hpp
index 6a1ea1a4..c50cf052 100644
--- a/compat/euler.hpp
+++ b/compat/euler.hpp
@@ -13,11 +13,11 @@ using dvec3 = Mat<double, 3, 1>;
using rmat = dmat<3, 3>;
using euler_t = dmat<3, 1>;
-rmat OPENTRACK_COMPAT_EXPORT euler_to_rmat(const euler_t& input);
+rmat OTR_COMPAT_EXPORT euler_to_rmat(const euler_t& input);
-euler_t OPENTRACK_COMPAT_EXPORT rmat_to_euler(const rmat& R);
+euler_t OTR_COMPAT_EXPORT rmat_to_euler(const rmat& R);
-void OPENTRACK_COMPAT_EXPORT tait_bryan_to_matrices(const euler_t& input,
+void OTR_COMPAT_EXPORT tait_bryan_to_matrices(const euler_t& input,
rmat& r_roll,
rmat& r_pitch,
rmat& r_yaw);
diff --git a/compat/export.hpp b/compat/export.hpp
index ba10f131..4bd6952f 100644
--- a/compat/export.hpp
+++ b/compat/export.hpp
@@ -1,27 +1,11 @@
+// generates export.hpp for each module from compat/linkage.hpp
+
#pragma once
-#ifdef BUILD_compat
-# ifdef _WIN32
-# define OPENTRACK_COMPAT_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_COMPAT_LINKAGE
-# endif
+#include "compat/linkage-macros.hpp"
-# ifndef _MSC_VER
-# define OPENTRACK_COMPAT_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_COMPAT_LINKAGE
-# else
-# define OPENTRACK_COMPAT_EXPORT OPENTRACK_COMPAT_LINKAGE
-# endif
+#ifdef BUILD_COMPAT
+# define OTR_COMPAT_EXPORT OTR_GENERIC_EXPORT
#else
- #ifdef _WIN32
- # define OPENTRACK_COMPAT_LINKAGE __declspec(dllimport)
- #else
- # define OPENTRACK_COMPAT_LINKAGE
- #endif
-
- #ifndef _MSC_VER
- # define OPENTRACK_COMPAT_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_COMPAT_LINKAGE
- #else
- # define OPENTRACK_COMPAT_EXPORT OPENTRACK_COMPAT_LINKAGE
- #endif
+# define OTR_COMPAT_EXPORT OTR_GENERIC_IMPORT
#endif
diff --git a/compat/linkage-macros.hpp b/compat/linkage-macros.hpp
new file mode 100644
index 00000000..b9bc9801
--- /dev/null
+++ b/compat/linkage-macros.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#if defined _MSC_VER || defined _WIN32
+# define OTR_GENERIC_EXPORT __declspec(dllexport)
+# define OTR_GENERIC_IMPORT __declspec(dllimport)
+#else
+# define OTR_GENERIC_EXPORT __attribute__ ((visibility ("default")))
+# define OTR_GENERIC_IMPORT
+#endif
+
+#if defined _MSC_VER
+# define OTR_GENERIC_TEMPLATE
+#else
+# define OTR_GENERIC_TEMPLATE __attribute__ ((visibility ("default")))
+#endif
diff --git a/compat/linkage.hpp b/compat/linkage.hpp
new file mode 100644
index 00000000..b49da34b
--- /dev/null
+++ b/compat/linkage.hpp
@@ -0,0 +1,11 @@
+// generates export.hpp for each module from compat/linkage.hpp
+
+#pragma once
+
+#include "compat/linkage-macros.hpp"
+
+#ifdef BUILD_${module}
+# define OTR_${module}_EXPORT OTR_GENERIC_EXPORT
+#else
+# define OTR_${module}_EXPORT OTR_GENERIC_IMPORT
+#endif
diff --git a/compat/nan.cpp b/compat/nan.cpp
index 4b99fff3..9c7bf147 100644
--- a/compat/nan.cpp
+++ b/compat/nan.cpp
@@ -4,7 +4,7 @@
# include <cmath>
# define my_isnan std::isnan
# define my_isinf std::isinf
-extern "C" OPENTRACK_COMPAT_EXPORT __declspec(noinline) bool nanp(double x)
+extern "C" OTR_COMPAT_EXPORT __declspec(noinline) bool nanp(double x)
#elif defined __MINGW32__
int __cdecl my_isnan(double)__asm__("__isnan");
@@ -18,12 +18,12 @@ int __cdecl my_fpclassify(double)__asm__("___fpclassify");
#define my_isinf(x) (my_fpclassify(x) == FP_INFINITE)
-extern "C" OPENTRACK_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double x)
+extern "C" OTR_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double x)
#else
int my_isnan(double)__asm__("isnan");
int my_isinf(double)__asm__("isinf");
-extern "C" OPENTRACK_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double x)
+extern "C" OTR_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double x)
#endif
{
return my_isnan(x) || my_isinf(x);
diff --git a/compat/nan.hpp b/compat/nan.hpp
index 9926da13..0a2c900c 100644
--- a/compat/nan.hpp
+++ b/compat/nan.hpp
@@ -3,9 +3,9 @@
#include "export.hpp"
#if defined(__GNUC__)
-extern "C" OPENTRACK_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double value);
+extern "C" OTR_COMPAT_EXPORT bool __attribute__ ((noinline)) nanp(double value);
#elif defined(_WIN32)
-extern "C" OPENTRACK_COMPAT_EXPORT __declspec(noinline) bool nanp(double value);
+extern "C" OTR_COMPAT_EXPORT __declspec(noinline) bool nanp(double value);
#else
-extern "C" OPENTRACK_COMPAT_EXPORT bool nanp(double value);
+extern "C" OTR_COMPAT_EXPORT bool nanp(double value);
#endif
diff --git a/compat/shm.h b/compat/shm.h
index f212dc17..ffd1e1dc 100644
--- a/compat/shm.h
+++ b/compat/shm.h
@@ -26,7 +26,7 @@
#include "export.hpp"
-class OPENTRACK_COMPAT_EXPORT PortableLockedShm {
+class OTR_COMPAT_EXPORT PortableLockedShm {
public:
PortableLockedShm(const char *shmName, const char *mutexName, int mapSize);
~PortableLockedShm();
diff --git a/compat/timer.hpp b/compat/timer.hpp
index 288bfb1d..e9efba79 100644
--- a/compat/timer.hpp
+++ b/compat/timer.hpp
@@ -20,7 +20,7 @@
#include <ctime>
#include <tuple>
-class OPENTRACK_COMPAT_EXPORT Timer
+class OTR_COMPAT_EXPORT Timer
{
struct timespec state;
long long conv_nsecs(const struct timespec& cur) const;
diff --git a/csv/csv.h b/csv/csv.h
index bb058586..e88a10b2 100644
--- a/csv/csv.h
+++ b/csv/csv.h
@@ -9,7 +9,7 @@
#include "export.hpp"
-class OPENTRACK_CSV_EXPORT CSV
+class OTR_CSV_EXPORT CSV
{
public:
QString readLine();
diff --git a/csv/export.hpp b/csv/export.hpp
index eb8d723f..7d7dbe29 100644
--- a/csv/export.hpp
+++ b/csv/export.hpp
@@ -1,28 +1,11 @@
-#pragma once
+// generates export.hpp for each module from compat/linkage.hpp
-#ifdef BUILD_csv
-# ifdef _WIN32
-# define OPENTRACK_CSV_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_CSV_LINKAGE
-# endif
+#pragma once
-# ifndef _MSC_VER
-# define OPENTRACK_CSV_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_CSV_LINKAGE
-# else
-# define OPENTRACK_CSV_EXPORT OPENTRACK_CSV_LINKAGE
-# endif
+#include "compat/linkage-macros.hpp"
+#ifdef BUILD_CSV
+# define OTR_CSV_EXPORT OTR_GENERIC_EXPORT
#else
- #ifdef _WIN32
- # define OPENTRACK_CSV_LINKAGE __declspec(dllimport)
- #else
- # define OPENTRACK_CSV_LINKAGE
- #endif
-
- #ifndef _MSC_VER
- # define OPENTRACK_CSV_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_CSV_LINKAGE
- #else
- # define OPENTRACK_CSV_EXPORT OPENTRACK_CSV_LINKAGE
- #endif
+# define OTR_CSV_EXPORT OTR_GENERIC_IMPORT
#endif
diff --git a/dinput/dinput.hpp b/dinput/dinput.hpp
index 48132e76..afc29d29 100644
--- a/dinput/dinput.hpp
+++ b/dinput/dinput.hpp
@@ -24,7 +24,7 @@ typedef void* LPDIRECTINPUT8;
template struct __declspec(dllexport) std::atomic<int>;
#endif
-class OPENTRACK_DINPUT_EXPORT dinput_handle final
+class OTR_DINPUT_EXPORT dinput_handle final
{
public:
class di_t;
diff --git a/dinput/export.hpp b/dinput/export.hpp
index 51ee4531..8c6fa27b 100644
--- a/dinput/export.hpp
+++ b/dinput/export.hpp
@@ -1,28 +1,11 @@
-#pragma once
+// generates export.hpp for each module from compat/linkage.hpp
-#ifdef BUILD_dinput
-# ifdef _WIN32
-# define OPENTRACK_DINPUT_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_DINPUT_LINKAGE
-# endif
+#pragma once
-# ifndef _MSC_VER
-# define OPENTRACK_DINPUT_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_DINPUT_LINKAGE
-# else
-# define OPENTRACK_DINPUT_EXPORT OPENTRACK_DINPUT_LINKAGE
-# endif
+#include "compat/linkage-macros.hpp"
+#ifdef BUILD_DINPUT
+# define OTR_DINPUT_EXPORT OTR_GENERIC_EXPORT
#else
-#ifdef _WIN32
-# define OPENTRACK_DINPUT_LINKAGE __declspec(dllimport)
-#else
-# define OPENTRACK_DINPUT_LINKAGE
-#endif
-
-#ifndef _MSC_VER
-# define OPENTRACK_DINPUT_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_DINPUT_LINKAGE
-#else
-# define OPENTRACK_DINPUT_EXPORT OPENTRACK_DINPUT_LINKAGE
-#endif
+# define OTR_DINPUT_EXPORT OTR_GENERIC_IMPORT
#endif
diff --git a/dinput/keybinding-worker.hpp b/dinput/keybinding-worker.hpp
index c4b441b8..553a314c 100644
--- a/dinput/keybinding-worker.hpp
+++ b/dinput/keybinding-worker.hpp
@@ -21,7 +21,7 @@
#include <functional>
#include <vector>
-struct OPENTRACK_DINPUT_EXPORT Key
+struct OTR_DINPUT_EXPORT Key
{
QString guid;
int keycode;
@@ -37,7 +37,7 @@ public:
bool should_process();
};
-struct OPENTRACK_DINPUT_EXPORT KeybindingWorker : private QThread
+struct OTR_DINPUT_EXPORT KeybindingWorker : private QThread
{
using fun = std::function<void(const Key&)>;
diff --git a/dinput/win32-joystick.hpp b/dinput/win32-joystick.hpp
index 6454c51c..4e72853f 100644
--- a/dinput/win32-joystick.hpp
+++ b/dinput/win32-joystick.hpp
@@ -35,7 +35,7 @@ struct hash<QString>
};
}
-struct OPENTRACK_DINPUT_EXPORT win32_joy_ctx
+struct OTR_DINPUT_EXPORT win32_joy_ctx
{
using fn = std::function<void(const QString& guid, int btn, bool held)>;
@@ -77,7 +77,7 @@ struct OPENTRACK_DINPUT_EXPORT win32_joy_ctx
private:
static QString guid_to_string(const GUID& guid);
- class OPENTRACK_DINPUT_EXPORT enum_state final
+ class OTR_DINPUT_EXPORT enum_state final
{
std::vector<QString> all;
joys_t joys;
diff --git a/logic/export.hpp b/logic/export.hpp
index 2503f3a6..b737e98e 100644
--- a/logic/export.hpp
+++ b/logic/export.hpp
@@ -1,28 +1,11 @@
-#pragma once
+// generates export.hpp for each module from compat/linkage.hpp
-#ifdef BUILD_logic
-# ifdef _WIN32
-# define OPENTRACK_LOGIC_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_LOGIC_LINKAGE
-# endif
+#pragma once
-# ifndef _MSC_VER
-# define OPENTRACK_LOGIC_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_LOGIC_LINKAGE
-# else
-# define OPENTRACK_LOGIC_EXPORT OPENTRACK_LOGIC_LINKAGE
-# endif
+#include "compat/linkage-macros.hpp"
+#ifdef BUILD_LOGIC
+# define OTR_LOGIC_EXPORT OTR_GENERIC_EXPORT
#else
-#ifdef _WIN32
-# define OPENTRACK_LOGIC_LINKAGE __declspec(dllimport)
-#else
-# define OPENTRACK_LOGIC_LINKAGE
-#endif
-
-#ifndef _MSC_VER
-# define OPENTRACK_LOGIC_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_LOGIC_LINKAGE
-#else
-# define OPENTRACK_LOGIC_EXPORT OPENTRACK_LOGIC_LINKAGE
-#endif
+# define OTR_LOGIC_EXPORT OTR_GENERIC_IMPORT
#endif
diff --git a/logic/main-settings.hpp b/logic/main-settings.hpp
index 49894820..20805059 100644
--- a/logic/main-settings.hpp
+++ b/logic/main-settings.hpp
@@ -21,7 +21,7 @@ namespace axis_clamp_opts
} // ns axis-clamp-opts
-struct OPENTRACK_LOGIC_EXPORT axis_opts final
+struct OTR_LOGIC_EXPORT axis_opts final
{
enum max_clamp
{
@@ -52,7 +52,7 @@ private:
static inline QString n(QString pfx, QString name);
};
-struct OPENTRACK_LOGIC_EXPORT key_opts
+struct OTR_LOGIC_EXPORT key_opts
{
value<QString> keycode, guid;
value<int> button;
@@ -60,14 +60,14 @@ struct OPENTRACK_LOGIC_EXPORT key_opts
key_opts(bundle b, const QString& name);
};
-struct OPENTRACK_LOGIC_EXPORT module_settings
+struct OTR_LOGIC_EXPORT module_settings
{
bundle b;
value<QString> tracker_dll, filter_dll, protocol_dll;
module_settings();
};
-struct OPENTRACK_LOGIC_EXPORT main_settings final
+struct OTR_LOGIC_EXPORT main_settings final
{
bundle b, b_map;
axis_opts a_x, a_y, a_z;
diff --git a/logic/mappings.hpp b/logic/mappings.hpp
index 6d028c10..4e0f7218 100644
--- a/logic/mappings.hpp
+++ b/logic/mappings.hpp
@@ -13,7 +13,7 @@ using namespace options;
#include "spline/spline.hpp"
#include "main-settings.hpp"
-struct OPENTRACK_LOGIC_EXPORT Map final
+struct OTR_LOGIC_EXPORT Map final
{
Map(QString primary, QString secondary, int max_x, int max_y, axis_opts& opts);
@@ -25,7 +25,7 @@ struct OPENTRACK_LOGIC_EXPORT Map final
spline spline_main, spline_alt;
};
-class OPENTRACK_LOGIC_EXPORT Mappings final
+class OTR_LOGIC_EXPORT Mappings final
{
private:
Map axes[6];
diff --git a/logic/selected-libraries.hpp b/logic/selected-libraries.hpp
index d782374c..689cbec3 100644
--- a/logic/selected-libraries.hpp
+++ b/logic/selected-libraries.hpp
@@ -13,7 +13,7 @@
#include "export.hpp"
-struct OPENTRACK_LOGIC_EXPORT SelectedLibraries
+struct OTR_LOGIC_EXPORT SelectedLibraries
{
using dylibptr = mem<dylib>;
mem<ITracker> pTracker;
diff --git a/logic/shortcuts.h b/logic/shortcuts.h
index 5a96e983..5f23d2e7 100644
--- a/logic/shortcuts.h
+++ b/logic/shortcuts.h
@@ -27,7 +27,7 @@
using namespace options;
-struct OPENTRACK_LOGIC_EXPORT Shortcuts final : public QObject
+struct OTR_LOGIC_EXPORT Shortcuts final : public QObject
{
Q_OBJECT
diff --git a/logic/tracker.h b/logic/tracker.h
index 6b9b07ee..4295822e 100644
--- a/logic/tracker.h
+++ b/logic/tracker.h
@@ -51,7 +51,7 @@ struct bits
bits();
};
-class OPENTRACK_LOGIC_EXPORT Tracker : private QThread, private bits
+class OTR_LOGIC_EXPORT Tracker : private QThread, private bits
{
Q_OBJECT
private:
diff --git a/logic/tracklogger.hpp b/logic/tracklogger.hpp
index 19e16fef..0a8d5410 100644
--- a/logic/tracklogger.hpp
+++ b/logic/tracklogger.hpp
@@ -8,7 +8,7 @@
#include <QMessageBox>
#include <QWidget>
-class OPENTRACK_LOGIC_EXPORT TrackLogger
+class OTR_LOGIC_EXPORT TrackLogger
{
TrackLogger(TrackLogger&&) = delete;
TrackLogger(const TrackLogger&) = delete;
@@ -46,7 +46,7 @@ public:
};
-class OPENTRACK_LOGIC_EXPORT TrackLoggerCSV : public TrackLogger
+class OTR_LOGIC_EXPORT TrackLoggerCSV : public TrackLogger
{
std::ofstream out;
bool first_col;
diff --git a/logic/win32-shortcuts.h b/logic/win32-shortcuts.h
index 7626a31f..4e32c9ea 100644
--- a/logic/win32-shortcuts.h
+++ b/logic/win32-shortcuts.h
@@ -12,7 +12,7 @@ extern QList<win_key> windows_key_sequences;
#include "export.hpp"
-struct OPENTRACK_LOGIC_EXPORT win_key
+struct OTR_LOGIC_EXPORT win_key
{
win_key(int win, Qt::Key qt) : win(win), qt(qt) {}
int win;
diff --git a/logic/work.hpp b/logic/work.hpp
index f0aae28a..f1d5e401 100644
--- a/logic/work.hpp
+++ b/logic/work.hpp
@@ -24,7 +24,7 @@
#include <tuple>
#include <functional>
-struct OPENTRACK_LOGIC_EXPORT Work
+struct OTR_LOGIC_EXPORT Work
{
using fn_t = std::function<void(bool)>;
using key_tuple = std::tuple<key_opts&, fn_t, bool>;
diff --git a/migration/export.hpp b/migration/export.hpp
index 800ddf35..8757e7ea 100644
--- a/migration/export.hpp
+++ b/migration/export.hpp
@@ -1,28 +1,11 @@
-#pragma once
+// generates export.hpp for each module from compat/linkage.hpp
-#ifdef BUILD_migration
-# ifdef _WIN32
-# define OPENTRACK_MIGRATION_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_MIGRATION_LINKAGE
-# endif
+#pragma once
-# ifndef _MSC_VER
-# define OPENTRACK_MIGRATION_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_MIGRATION_LINKAGE
-# else
-# define OPENTRACK_MIGRATION_EXPORT OPENTRACK_MIGRATION_LINKAGE
-# endif
+#include "compat/linkage-macros.hpp"
+#ifdef BUILD_MIGRATION
+# define OTR_MIGRATION_EXPORT OTR_GENERIC_EXPORT
#else
- #ifdef _WIN32
- # define OPENTRACK_MIGRATION_LINKAGE __declspec(dllimport)
- #else
- # define OPENTRACK_MIGRATION_LINKAGE
- #endif
-
- #ifndef _MSC_VER
- # define OPENTRACK_MIGRATION_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_MIGRATION_LINKAGE
- #else
- # define OPENTRACK_MIGRATION_EXPORT OPENTRACK_MIGRATION_LINKAGE
- #endif
+# define OTR_MIGRATION_EXPORT OTR_GENERIC_IMPORT
#endif
diff --git a/migration/migration.hpp b/migration/migration.hpp
index e7b42152..5f99de7a 100644
--- a/migration/migration.hpp
+++ b/migration/migration.hpp
@@ -73,5 +73,5 @@ public:
}
-OPENTRACK_MIGRATION_EXPORT std::vector<QString> run_migrations();
-OPENTRACK_MIGRATION_EXPORT void mark_config_as_not_needing_migration();
+OTR_MIGRATION_EXPORT std::vector<QString> run_migrations();
+OTR_MIGRATION_EXPORT void mark_config_as_not_needing_migration();
diff --git a/options/bundle.cpp b/options/bundle.cpp
index 48833266..43f4a8e3 100644
--- a/options/bundle.cpp
+++ b/options/bundle.cpp
@@ -193,7 +193,7 @@ std::shared_ptr<bundler::v> bundler::make_bundle(const bundler::k& key)
return shr;
}
-OPENTRACK_OPTIONS_EXPORT bundler& singleton()
+OTR_OPTIONS_EXPORT bundler& singleton()
{
static bundler ret;
return ret;
@@ -203,7 +203,7 @@ QMutex* bundle::get_mtx() const { return mtx; }
} // end options::detail
-OPENTRACK_OPTIONS_EXPORT std::shared_ptr<bundle_> make_bundle(const QString& name)
+OTR_OPTIONS_EXPORT std::shared_ptr<bundle_> make_bundle(const QString& name)
{
if (name.size())
return detail::singleton().make_bundle(name);
diff --git a/options/bundle.hpp b/options/bundle.hpp
index 64210d33..f05999a7 100644
--- a/options/bundle.hpp
+++ b/options/bundle.hpp
@@ -36,11 +36,11 @@ void set_base_value_to_default(base_value* val);
struct bundler;
-class OPENTRACK_OPTIONS_EXPORT bundle final : public QObject, public connector
+class OTR_OPTIONS_EXPORT bundle final : public QObject, public connector
{
Q_OBJECT
- class OPENTRACK_OPTIONS_EXPORT mutex final : public QMutex
+ class OTR_OPTIONS_EXPORT mutex final : public QMutex
{
public:
mutex(QMutex::RecursionMode mode) : QMutex(mode) {}
@@ -86,9 +86,9 @@ public slots:
void set_all_to_default();
};
-OPENTRACK_OPTIONS_EXPORT bundler& singleton();
+OTR_OPTIONS_EXPORT bundler& singleton();
-struct OPENTRACK_OPTIONS_EXPORT bundler
+struct OTR_OPTIONS_EXPORT bundler
{
public:
using k = QString;
@@ -106,12 +106,12 @@ public:
static void refresh_all_bundles();
};
-OPENTRACK_OPTIONS_EXPORT bundler& singleton();
+OTR_OPTIONS_EXPORT bundler& singleton();
}
using bundle_ = detail::bundle;
using bundle = std::shared_ptr<bundle_>;
-OPENTRACK_OPTIONS_EXPORT std::shared_ptr<bundle_> make_bundle(const QString& name);
+OTR_OPTIONS_EXPORT std::shared_ptr<bundle_> make_bundle(const QString& name);
}
diff --git a/options/export.hpp b/options/export.hpp
index c430540f..6cce27fa 100644
--- a/options/export.hpp
+++ b/options/export.hpp
@@ -1,27 +1,11 @@
+// generates export.hpp for each module from compat/linkage.hpp
+
#pragma once
-#ifdef BUILD_options
-# ifdef _WIN32
-# define OPENTRACK_OPTIONS_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_OPTIONS_LINKAGE
-# endif
+#include "compat/linkage-macros.hpp"
-# ifndef _MSC_VER
-# define OPENTRACK_OPTIONS_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_OPTIONS_LINKAGE
-# else
-# define OPENTRACK_OPTIONS_EXPORT OPENTRACK_OPTIONS_LINKAGE
-# endif
+#ifdef BUILD_OPTIONS
+# define OTR_OPTIONS_EXPORT OTR_GENERIC_EXPORT
#else
- #ifdef _WIN32
- # define OPENTRACK_OPTIONS_LINKAGE __declspec(dllimport)
- #else
- # define OPENTRACK_OPTIONS_LINKAGE
- #endif
-
- #ifndef _MSC_VER
- # define OPENTRACK_OPTIONS_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_OPTIONS_LINKAGE
- #else
- # define OPENTRACK_OPTIONS_EXPORT OPENTRACK_OPTIONS_LINKAGE
- #endif
+# define OTR_OPTIONS_EXPORT OTR_GENERIC_IMPORT
#endif
diff --git a/options/group.hpp b/options/group.hpp
index 82b508af..e2a8058c 100644
--- a/options/group.hpp
+++ b/options/group.hpp
@@ -12,7 +12,7 @@
namespace options {
// snapshot of qsettings group at given time
-class OPENTRACK_OPTIONS_EXPORT group final
+class OTR_OPTIONS_EXPORT group final
{
QString name;
public:
diff --git a/options/scoped.hpp b/options/scoped.hpp
index fd797219..8652bfff 100644
--- a/options/scoped.hpp
+++ b/options/scoped.hpp
@@ -9,7 +9,7 @@
namespace options {
-struct OPENTRACK_OPTIONS_EXPORT opts
+struct OTR_OPTIONS_EXPORT opts
{
bundle b;
opts(const QString& name);
diff --git a/options/slider.hpp b/options/slider.hpp
index 1ae63d10..48b690d2 100644
--- a/options/slider.hpp
+++ b/options/slider.hpp
@@ -14,7 +14,7 @@
namespace options
{
- class OPENTRACK_OPTIONS_EXPORT slider_value final
+ class OTR_OPTIONS_EXPORT slider_value final
{
double cur_, min_, max_;
public:
diff --git a/options/tie.cpp b/options/tie.cpp
index 873c7087..7a78237f 100644
--- a/options/tie.cpp
+++ b/options/tie.cpp
@@ -10,7 +10,7 @@
namespace options {
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb)
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb)
{
cb->setCurrentIndex(v);
v = cb->currentIndex();
@@ -18,7 +18,7 @@ OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb)
base_value::connect(&v, SIGNAL(valueChanged(int)), cb, SLOT(setCurrentIndex(int)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb)
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb)
{
cb->setCurrentText(v);
v = cb->currentText();
@@ -26,28 +26,28 @@ OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb)
base_value::connect(&v, SIGNAL(valueChanged(QString)), cb, SLOT(setCurrentText(QString)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<bool>& v, QCheckBox* cb)
+OTR_OPTIONS_EXPORT void tie_setting(value<bool>& v, QCheckBox* cb)
{
cb->setChecked(v);
base_value::connect(cb, SIGNAL(toggled(bool)), &v, SLOT(setValue(bool)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(bool)), cb, SLOT(setChecked(bool)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<double>& v, QDoubleSpinBox* dsb)
+OTR_OPTIONS_EXPORT void tie_setting(value<double>& v, QDoubleSpinBox* dsb)
{
dsb->setValue(v);
base_value::connect(dsb, SIGNAL(valueChanged(double)), &v, SLOT(setValue(double)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(double)), dsb, SLOT(setValue(double)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSpinBox* sb)
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QSpinBox* sb)
{
sb->setValue(v);
base_value::connect(sb, SIGNAL(valueChanged(int)), &v, SLOT(setValue(int)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(int)), sb, SLOT(setValue(int)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl)
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl)
{
sl->setValue(v);
v = sl->value();
@@ -55,27 +55,27 @@ OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl)
base_value::connect(&v, SIGNAL(valueChanged(int)), sl, SLOT(setValue(int)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLineEdit* le)
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLineEdit* le)
{
le->setText(v);
base_value::connect(le, SIGNAL(textChanged(QString)), &v, SLOT(setValue(QString)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(QString)),le, SLOT(setText(QString)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLabel* lb)
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLabel* lb)
{
lb->setText(v);
base_value::connect(&v, SIGNAL(valueChanged(QString)), lb, SLOT(setText(QString)), v.DIRECT_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QTabWidget* t)
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QTabWidget* t)
{
t->setCurrentIndex(v);
base_value::connect(t, SIGNAL(currentChanged(int)), &v, SLOT(setValue(int)), v.DIRECT_CONNTYPE);
base_value::connect(&v, SIGNAL(valueChanged(int)), t, SLOT(setCurrentIndex(int)), v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<slider_value>& v, QSlider* w)
+OTR_OPTIONS_EXPORT void tie_setting(value<slider_value>& v, QSlider* w)
{
{
const int q_min = w->minimum();
diff --git a/options/tie.hpp b/options/tie.hpp
index 74817a1f..1745438f 100644
--- a/options/tie.hpp
+++ b/options/tie.hpp
@@ -47,15 +47,15 @@ tie_setting(value<t>& v, QComboBox* cb)
v.SAFE_CONNTYPE);
}
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<bool>& v, QCheckBox* cb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<double>& v, QDoubleSpinBox* dsb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSpinBox* sb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLineEdit* le);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLabel* lb);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<int>& v, QTabWidget* t);
-OPENTRACK_OPTIONS_EXPORT void tie_setting(value<slider_value>& v, QSlider* w);
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QComboBox* cb);
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QComboBox* cb);
+OTR_OPTIONS_EXPORT void tie_setting(value<bool>& v, QCheckBox* cb);
+OTR_OPTIONS_EXPORT void tie_setting(value<double>& v, QDoubleSpinBox* dsb);
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QSpinBox* sb);
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QSlider* sl);
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLineEdit* le);
+OTR_OPTIONS_EXPORT void tie_setting(value<QString>& v, QLabel* lb);
+OTR_OPTIONS_EXPORT void tie_setting(value<int>& v, QTabWidget* t);
+OTR_OPTIONS_EXPORT void tie_setting(value<slider_value>& v, QSlider* w);
} // ns options
diff --git a/options/value.hpp b/options/value.hpp
index 204fa15a..83529262 100644
--- a/options/value.hpp
+++ b/options/value.hpp
@@ -37,7 +37,7 @@ template<typename u> struct value_type_traits<QList<u>>
template<typename t> using value_type_t = typename value_type_traits<t>::type;
}
-class OPENTRACK_OPTIONS_EXPORT base_value : public QObject
+class OTR_OPTIONS_EXPORT base_value : public QObject
{
Q_OBJECT
friend class ::options::detail::connector;
diff --git a/pose-widget/glwidget.h b/pose-widget/glwidget.h
index ae06e5c5..66d4289d 100644
--- a/pose-widget/glwidget.h
+++ b/pose-widget/glwidget.h
@@ -13,7 +13,7 @@
#include "api/plugin-api.hpp"
#include "compat/euler.hpp"
-#ifdef BUILD_pose_widget
+#ifdef BUILD_POSE_WIDGET
# define POSE_WIDGET_EXPORT Q_DECL_EXPORT
#else
# define POSE_WIDGET_EXPORT Q_DECL_IMPORT
diff --git a/spline/export.hpp b/spline/export.hpp
index 4875b4c1..180ce0f2 100644
--- a/spline/export.hpp
+++ b/spline/export.hpp
@@ -1,27 +1,11 @@
+// generates export.hpp for each module from compat/linkage.hpp
+
#pragma once
-#ifdef BUILD_spline_widget
-# ifdef _WIN32
-# define OPENTRACK_SPLINE_LINKAGE __declspec(dllexport)
-# else
-# define OPENTRACK_SPLINE_LINKAGE
-# endif
+#include "compat/linkage-macros.hpp"
-# ifndef _MSC_VER
-# define OPENTRACK_SPLINE_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_SPLINE_LINKAGE
-# else
-# define OPENTRACK_SPLINE_EXPORT OPENTRACK_SPLINE_LINKAGE
-# endif
+#ifdef BUILD_SPLINE
+# define OTR_SPLINE_EXPORT OTR_GENERIC_EXPORT
#else
- #ifdef _WIN32
- # define OPENTRACK_SPLINE_LINKAGE __declspec(dllimport)
- #else
- # define OPENTRACK_SPLINE_LINKAGE
- #endif
-
- #ifndef _MSC_VER
- # define OPENTRACK_SPLINE_EXPORT __attribute__ ((visibility ("default"))) OPENTRACK_SPLINE_LINKAGE
- #else
- # define OPENTRACK_SPLINE_EXPORT OPENTRACK_SPLINE_LINKAGE
- #endif
+# define OTR_SPLINE_EXPORT OTR_GENERIC_IMPORT
#endif
diff --git a/spline/spline-widget.hpp b/spline/spline-widget.hpp
index 4d5a7680..062db493 100644
--- a/spline/spline-widget.hpp
+++ b/spline/spline-widget.hpp
@@ -27,7 +27,7 @@ using namespace options;
#include <QDebug>
-class OPENTRACK_SPLINE_EXPORT spline_widget final : public QWidget
+class OTR_SPLINE_EXPORT spline_widget final : public QWidget
{
Q_OBJECT
Q_PROPERTY(QColor colorBezier READ colorBezier WRITE setColorBezier)
diff --git a/spline/spline.hpp b/spline/spline.hpp
index 77b2bdf9..067967b5 100644
--- a/spline/spline.hpp
+++ b/spline/spline.hpp
@@ -26,7 +26,7 @@ using namespace options;
namespace spline_detail {
-class OPENTRACK_SPLINE_EXPORT settings final : public QObject
+class OTR_SPLINE_EXPORT settings final : public QObject
{
Q_OBJECT
public:
@@ -40,7 +40,7 @@ signals:
}
-class OPENTRACK_SPLINE_EXPORT spline final
+class OTR_SPLINE_EXPORT spline final
{
double precision(const QList<QPointF>& points) const;
void update_interp_data();