diff options
Diffstat (limited to 'video')
-rw-r--r-- | video/camera.hpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/video/camera.hpp b/video/camera.hpp index 21f4f916..4ad8417c 100644 --- a/video/camera.hpp +++ b/video/camera.hpp @@ -67,17 +67,14 @@ void register_camera(std::unique_ptr<impl::camera_> metadata); } // ns video::impl -#define OTR_REGISTER_CAMERA2(type, ctr) \ - namespace { \ - struct init_##ctr \ - { \ - static char fuzz; \ - }; \ - char init_##ctr :: fuzz = \ - (::video::impl::register_camera(std::make_unique<type>()), 0); \ - } // anon ns - -#define OTR_REGISTER_CAMERA(type) \ +#define OTR_REGISTER_CAMERA3(type, ctr) \ + static const char init_ ## ctr = \ + (::video::impl::register_camera(std::make_unique<type>()), 0); + +#define OTR_REGISTER_CAMERA2(type, ctr) \ + OTR_REGISTER_CAMERA3(type, ctr) + +#define OTR_REGISTER_CAMERA(type) \ OTR_REGISTER_CAMERA2(type, __COUNTER__) namespace video |