diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-19 12:44:31 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-19 12:44:31 +0200 |
commit | b365dab83fcc18965afb7c5d4b977e37544be392 (patch) | |
tree | 9a3af75ca5ae934b94d05ca44a3edf8a2f4be05d | |
parent | c5a652e9ad60f1ab0ee586d578daa0be79359b28 (diff) |
video: avoid symbol redefinition with multiple backends
-rw-r--r-- | video/camera.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/video/camera.hpp b/video/camera.hpp index d4d17c8f..189f95e1 100644 --- a/video/camera.hpp +++ b/video/camera.hpp @@ -77,18 +77,20 @@ void register_camera(std::unique_ptr<impl::camera_> metadata); #ifdef _MSC_VER // shared library targets without any symbols break cmake build -# define OTR_REGISTER_CAMERA_IMPL() \ - extern "C" __declspec(dllexport) [[maybe_unused]] void _opentrack_module(void) {} +# define OTR_REGISTER_CAMERA_IMPL(type) \ + extern "C" __declspec(dllexport) [[maybe_unused]] \ + void _opentrack_module_video_ ##type (void) {} +# define OTR_REGISTER_CAMERA_IMPL2(type) \ + OTR_REGISTER_CAMERA_IMPL(type) #else -# define OTR_REGISTER_CAMERA_IMPL() +# define OTR_REGISTER_CAMERA_IMPL2(type) #endif #define OTR_REGISTER_CAMERA2(type, ctr) \ OTR_REGISTER_CAMERA3(type, ctr) \ - OTR_REGISTER_CAMERA_IMPL() + OTR_REGISTER_CAMERA_IMPL2(type) #define OTR_REGISTER_CAMERA(type) \ OTR_REGISTER_CAMERA2(type, __COUNTER__) - namespace video { using camera_impl = impl::camera; |