fix windows 32 bit builds
parent
ad2a1546eb
commit
bca5650578
|
@ -156,6 +156,13 @@ size_t DefaultIOStream::FileSize() const {
|
||||||
if (0 != err)
|
if (0 != err)
|
||||||
return 0;
|
return 0;
|
||||||
mCachedSize = (size_t)(fileStat.st_size);
|
mCachedSize = (size_t)(fileStat.st_size);
|
||||||
|
#elif defined _WIN32
|
||||||
|
struct _stat32 fileStat;
|
||||||
|
//using fileno + fstat avoids having to handle the filename
|
||||||
|
int err = _fstat32(_fileno(mFile), &fileStat);
|
||||||
|
if (0 != err)
|
||||||
|
return 0;
|
||||||
|
mCachedSize = (size_t)(fileStat.st_size);
|
||||||
#elif defined __GNUC__ || defined __APPLE__ || defined __MACH__ || defined __FreeBSD__
|
#elif defined __GNUC__ || defined __APPLE__ || defined __MACH__ || defined __FreeBSD__
|
||||||
struct stat fileStat;
|
struct stat fileStat;
|
||||||
int err = stat(mFilename.c_str(), &fileStat);
|
int err = stat(mFilename.c_str(), &fileStat);
|
||||||
|
|
|
@ -128,7 +128,7 @@ bool EmbedTexturesProcess::addTexture(aiScene *pScene, const std::string &path)
|
||||||
|
|
||||||
aiTexel* imageContent = new aiTexel[ 1ul + static_cast<unsigned long>( imageSize ) / sizeof(aiTexel)];
|
aiTexel* imageContent = new aiTexel[ 1ul + static_cast<unsigned long>( imageSize ) / sizeof(aiTexel)];
|
||||||
pFile->Seek(0, aiOrigin_SET);
|
pFile->Seek(0, aiOrigin_SET);
|
||||||
pFile->Read(reinterpret_cast<char*>(imageContent), imageSize, 1);
|
pFile->Read(reinterpret_cast<char*>(imageContent), static_cast<size_t>(imageSize), 1);
|
||||||
mIOHandler->Close(pFile);
|
mIOHandler->Close(pFile);
|
||||||
|
|
||||||
// Enlarging the textures table
|
// Enlarging the textures table
|
||||||
|
|
Loading…
Reference in New Issue