diff --git a/src/collada/converter.cpp b/src/collada/converter.cpp index 8260dc7a..43a0516b 100644 --- a/src/collada/converter.cpp +++ b/src/collada/converter.cpp @@ -1104,8 +1104,8 @@ void ColladaConverter::convert(const std::string &inputFile, MemBufInputSource* memBufIS = new MemBufInputSource((const XMLByte*) xmlString.c_str(), xmlString.length(), "bufID", false); Wrapper4InputSource *wrapper = new Wrapper4InputSource(memBufIS, false); - DOMDocument *doc = parser->parse(wrapper); - DOMDocument *adj = parser->parseURI(adjustmentFile.c_str()); + XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc = parser->parse(wrapper); + XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *adj = parser->parseURI(adjustmentFile.c_str()); std::set removals; findRemovals(adj, removals); diff --git a/src/collada/main.cpp b/src/collada/main.cpp index 17a86d75..452fa2a6 100644 --- a/src/collada/main.cpp +++ b/src/collada/main.cpp @@ -34,6 +34,9 @@ #include "converter.h" #include #include +#if defined(WIN32) +#include "../mitsuba/getopt.h" +#endif XERCES_CPP_NAMESPACE_USE diff --git a/src/mitsuba/mtsutil.cpp b/src/mitsuba/mtsutil.cpp index 11628c55..8353f73c 100644 --- a/src/mitsuba/mtsutil.cpp +++ b/src/mitsuba/mtsutil.cpp @@ -8,12 +8,12 @@ #include #include #include -#include #include #include "shandler.h" #if !defined(WIN32) #include +#include #endif #if defined(WIN32) @@ -166,22 +166,31 @@ void help() { cout << " -v Be more verbose" << endl << endl; FileResolver *resolver = FileResolver::getInstance(); + cout << "The following utilities are available:" << endl << endl; + std::string dirPath = resolver->resolveAbsolute("plugins"); + +#if !defined(WIN32) DIR *directory; struct dirent *dirinfo; - std::string dirPath = resolver->resolveAbsolute("plugins"); if ((directory = opendir(dirPath.c_str())) == NULL) SLog(EInfo, "Could not open plugin directory"); - cout << "The following utilities are available:" << endl << endl; while ((dirinfo = readdir(directory)) != NULL) { std::string fname(dirinfo->d_name); - if (!endsWith(fname, ".dylib") && !endsWith(fname, ".dll") && !endsWith(fname, ".so")) + if (!endsWith(fname, ".dylib") !endsWith(fname, ".so")) continue; -#if defined(WIN32) - std::string fullName = dirPath + "\\" + fname; -#else std::string fullName = dirPath + "/" + fname; +#else + HANDLE hFind; + WIN32_FIND_DATA findFileData; + + if ((hFind = FindFirstFile((dirPath + "\\*.dll").c_str(), &findFileData)) == INVALID_HANDLE_VALUE) + SLog(EInfo, "Could not open plugin directory"); + + do { + std::string fname = findFileData.cFileName; + std::string fullName = dirPath + "\\" + fname; #endif UtilityPlugin utility(fullName); if (!utility.isUtility()) @@ -191,7 +200,12 @@ void help() { for (int i=0; i<22-(int) shortName.length(); ++i) cout << ' '; cout << utility.getDescription() << endl; +#if !defined(WIN32) } +#else + } while (FindNextFile(hFind, &findFileData)); + FindClose(hFind); +#endif }