[ 2373610 ] Patch for Linux and SCons. Added patch provided by John Connors, closed the corresponding tracker item.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@262 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2008-12-07 20:00:58 +00:00
parent f601c3c5b9
commit 321334fd12
13 changed files with 26 additions and 73 deletions

View File

@@ -46,6 +46,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "DefaultIOSystem.h"
#include "DefaultIOStream.h"
#ifdef __unix__
#include <sys/param.h>
#include <stdlib.h>
#endif
using namespace Assimp;
@@ -113,18 +118,19 @@ bool IOSystem::ComparePaths (const std::string& one,
return !ASSIMP_stricmp(one,second);
}
// this should be sufficient for all platforms :D
#define PATHLIMIT 1024
// this should be sufficient for all platforms :D -- not really :->
#define PATHLIMIT 4096
// ------------------------------------------------------------------------------------------------
// Convert a relative path into an absolute path
inline void MakeAbsolutePath (const std::string& in, char* _out)
{
#ifdef WIN32
::_fullpath(_out, in.c_str(),PATHLIMIT);
#else
realpath(in.c_str(), _out); //TODO not a save implementation realpath assumes that _out has the size PATH_MAX defined in limits.h; an error handling should be added to both versions
#endif
#ifdef _WIN32
::_fullpath(_out, in.c_str(),PATHLIMIT);
#else
// use realpath
realpath(in.c_str(), _out);
#endif
}
// ------------------------------------------------------------------------------------------------