]> git.mxchange.org Git - simgear.git/commitdiff
Fix headless build and reduce include dependencies.
authorThomas Geymayer <tomgey@gmail.com>
Wed, 4 Jun 2014 00:46:57 +0000 (02:46 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Wed, 4 Jun 2014 00:46:57 +0000 (02:46 +0200)
simgear/nasal/cppbind/detail/nasal_traits.hxx

index b37c5114adf3fa3f6f1a1923a441007c66f5a333..62c4d302bb253f86f314fab2484c575c3e5cdd65 100644 (file)
 #ifndef SG_NASAL_TRAITS_HXX_
 #define SG_NASAL_TRAITS_HXX_
 
-#include <simgear/structure/SGSharedPtr.hxx>
-#include <simgear/structure/SGWeakPtr.hxx>
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/is_base_of.hpp>
 
-#include <osg/ref_ptr>
-#include <osg/observer_ptr>
+// Forward declarations
+class SGWeakReferenced;
+template<class T> class SGSharedPtr;
+template<class T> class SGWeakPtr;
+template<class T> class SGVec2;
 
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
+namespace boost
+{
+  template<class T> class shared_ptr;
+  template<class T> class weak_ptr;
+}
+namespace osg
+{
+  template<class T> class ref_ptr;
+  template<class T> class observer_ptr;
 
-#include <boost/type_traits/integral_constant.hpp>
-#include <boost/type_traits/is_base_of.hpp>
+  class Vec2b;
+  class Vec2d;
+  class Vec2f;
+  class Vec2s;
+}
 
+// The actual traits...
 namespace nasal
 {
   template<class T>
@@ -42,25 +56,11 @@ namespace nasal
   struct attr< type >:\
     public boost::integral_constant<bool, true> {};
 
-#ifdef SGVec2_H
-  SG_MAKE_TRAIT(<class T>, SGVec2<T>, is_vec2)
-#endif
-
-#ifdef OSG_VEC2B
-  SG_MAKE_TRAIT(<>, osg::Vec2b, is_vec2)
-#endif
-
-#ifdef OSG_VEC2D
-  SG_MAKE_TRAIT(<>, osg::Vec2d, is_vec2)
-#endif
-
-#ifdef OSG_VEC2F
-  SG_MAKE_TRAIT(<>, osg::Vec2f, is_vec2)
-#endif
-
-#ifdef OSG_VEC2S
-  SG_MAKE_TRAIT(<>, osg::Vec2s, is_vec2)
-#endif
+SG_MAKE_TRAIT(<class T>, SGVec2<T>, is_vec2)
+SG_MAKE_TRAIT(<>, osg::Vec2b, is_vec2)
+SG_MAKE_TRAIT(<>, osg::Vec2d, is_vec2)
+SG_MAKE_TRAIT(<>, osg::Vec2f, is_vec2)
+SG_MAKE_TRAIT(<>, osg::Vec2s, is_vec2)
 
 #undef SG_MAKE_TRAIT