Fix travis compile: glTFImporter chokes on unavailability of WriteLazyDict<T>. It does not use it directly, but instantiation of LazyDict<T> creates a reference.

My understanding is that compilers were correct in rejecting this, but I may be missing some detail of C++' template instantiation rules.
pull/876/head
Alexander Gessler 2016-05-05 16:37:55 +02:00 committed by Alexander Gessler
parent 896120b76a
commit e5233283ef
2 changed files with 7 additions and 0 deletions

View File

@ -756,15 +756,19 @@ namespace glTF
virtual void AttachToDocument(Document& doc) = 0; virtual void AttachToDocument(Document& doc) = 0;
virtual void DetachFromDocument() = 0; virtual void DetachFromDocument() = 0;
#ifdef GLTF_ASSET_WITH_EXPORT_SUPPORT
virtual void WriteObjects(AssetWriter& writer) = 0; virtual void WriteObjects(AssetWriter& writer) = 0;
#endif
}; };
#ifdef GLTF_ASSET_WITH_EXPORT_SUPPORT
template<class T> template<class T>
class LazyDict; class LazyDict;
//! (Implemented in glTFAssetWriter.h) //! (Implemented in glTFAssetWriter.h)
template<class T> template<class T>
void WriteLazyDict(LazyDict<T>& d, AssetWriter& w); void WriteLazyDict(LazyDict<T>& d, AssetWriter& w);
#endif
//! Manages lazy loading of the glTF top-level objects, and keeps a reference to them by ID //! Manages lazy loading of the glTF top-level objects, and keeps a reference to them by ID
//! It is the owner the loaded objects, so when it is destroyed it also deletes them //! It is the owner the loaded objects, so when it is destroyed it also deletes them
@ -786,8 +790,10 @@ namespace glTF
void AttachToDocument(Document& doc); void AttachToDocument(Document& doc);
void DetachFromDocument(); void DetachFromDocument();
#ifdef GLTF_ASSET_WITH_EXPORT_SUPPORT
void WriteObjects(AssetWriter& writer) void WriteObjects(AssetWriter& writer)
{ WriteLazyDict<T>(*this, writer); } { WriteLazyDict<T>(*this, writer); }
#endif
Ref<T> Add(T* obj); Ref<T> Add(T* obj);

View File

@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef glTFAssetWriter_H_INC #ifndef glTFAssetWriter_H_INC
#define glTFAssetWriter_H_INC #define glTFAssetWriter_H_INC
#define GLTF_ASSET_WITH_EXPORT_SUPPORT
#include "glTFAsset.h" #include "glTFAsset.h"
namespace glTF namespace glTF