]> git.mxchange.org Git - simgear.git/commitdiff
Fix for OSG without OSG_INIT_SINGLETON_PROXY
authorThomas Geymayer <tomgey@gmail.com>
Sat, 13 Jul 2013 09:37:24 +0000 (11:37 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Sat, 13 Jul 2013 09:37:24 +0000 (11:37 +0200)
simgear/canvas/ODGauge.cxx

index ebc92fe582d309eb07ee815be77f38f1a80ca585..3f34f989a8635c27d26fc88e32066e83e2d83cad 100644 (file)
@@ -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))