From 486011dceb0b2438cb5971d3eb5489480e4ac7d8 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Sat, 13 Jul 2013 11:37:24 +0200 Subject: [PATCH] Fix for OSG without OSG_INIT_SINGLETON_PROXY --- simgear/canvas/ODGauge.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/simgear/canvas/ODGauge.cxx b/simgear/canvas/ODGauge.cxx index ebc92fe5..3f34f989 100644 --- a/simgear/canvas/ODGauge.cxx +++ b/simgear/canvas/ODGauge.cxx @@ -87,6 +87,18 @@ namespace canvas } }; +#ifndef OSG_INIT_SINGLETON_PROXY + /** + * http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/include/osg/Object + * + * Helper macro that creates a static proxy object to call singleton function + * on it's construction, ensuring that the singleton gets initialized at + * startup. + */ +# define OSG_INIT_SINGLETON_PROXY(ProxyName, Func)\ + static struct ProxyName{ ProxyName() { Func; } } s_##ProxyName; +#endif + OSG_INIT_SINGLETON_PROXY( PreOrderBinProxy, (osgUtil::RenderBin::addRenderBinPrototype("PreOrderBin", new PreOrderBin)) -- 2.39.5