Skip to content
Browse files

Fixes FCollada build with libxml2 2.9, patch by pcpa. Fixes #1656

git-svn-id: http://svn.wildfiregames.com/public/ps/trunk@12701 3db68df2-c116-0410-a063-a993310a9797
  • Loading branch information...
1 parent df24b2a commit 830f2a38eb8a196eae17dc790542b910c7cce014 ben committed Sep 24, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 libraries/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.cpp
View
9 libraries/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.cpp
@@ -523,8 +523,13 @@ bool FArchiveXML::EndExport(fm::vector<uint8>& outData)
xmlOutputBufferPtr buf = xmlAllocOutputBuffer(NULL);
xmlNodeDumpOutput(buf, rootNode->doc, rootNode, 0, 0, NULL);
- outData.resize(buf->buffer->use * sizeof(xmlChar));
- memcpy(outData.begin(), buf->buffer->content, outData.size());
+#ifdef LIBXML2_NEW_BUFFER
+ outData.resize(xmlOutputBufferGetSize(buf) * sizeof(xmlChar));
+ memcpy(outData.begin(), xmlOutputBufferGetContent(buf), outData.size());
+#else
+ outData.resize(buf->buffer->use * sizeof(xmlChar));
+ memcpy(outData.begin(), buf->buffer->content, outData.size());
+#endif
xmlOutputBufferClose(buf);
daeDocument.ReleaseXmlData();

0 comments on commit 830f2a3

Please sign in to comment.
Something went wrong with that request. Please try again.