From e2dc4c3a66a53109616bff726bb4f4e198af580b Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 27 Aug 2010 13:22:05 +0200 Subject: Core/Dep: More hacking on g3d library (updated .diff) should now build on windows --HG-- branch : trunk --- dep/g3dlite/source/FileSystem.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'dep/g3dlite/source/FileSystem.cpp') diff --git a/dep/g3dlite/source/FileSystem.cpp b/dep/g3dlite/source/FileSystem.cpp index 3a1765714b0..2cf890a1cd5 100644 --- a/dep/g3dlite/source/FileSystem.cpp +++ b/dep/g3dlite/source/FileSystem.cpp @@ -12,7 +12,9 @@ #include "G3D/fileutils.h" #include #include -#include "zip.h" +#if _HAVE_ZIP /* G3DFIX: Use ZIP-library only if defined */ + #include "zip.h" +#endif #include "G3D/g3dfnmatch.h" #include "G3D/BinaryInput.h" #include "G3D/BinaryOutput.h" @@ -78,6 +80,7 @@ bool FileSystem::Dir::contains(const std::string& f) const { } void FileSystem::Dir::computeZipListing(const std::string& zipfile, const std::string& pathInsideZipfile) { +#if _HAVE_ZIP /* G3DFIX: Use ZIP-library only if defined */ struct zip* z = zip_open( FilePath::removeTrailingSlash(zipfile).c_str(), ZIP_CHECKCONS, NULL ); debugAssert(z); @@ -126,6 +129,7 @@ void FileSystem::Dir::computeZipListing(const std::string& zipfile, const std::s zip_close(z); z = NULL; +#endif } @@ -522,6 +526,7 @@ int64 FileSystem::_size(const std::string& filename) { int result = stat64(filename.c_str(), &st); if (result == -1) { +#if _HAVE_ZIP /* G3DFIX: Use ZIP-library only if defined */ std::string zip, contents; if (zipfileExists(filename, zip, contents)) { int64 requiredMem; @@ -538,8 +543,11 @@ int64 FileSystem::_size(const std::string& filename) { zip_close(z); return requiredMem; } else { +#endif return -1; +#if _HAVE_ZIP /* G3DFIX: Use ZIP-library only if defined */ } +#endif } return st.st_size; -- cgit v1.2.3