summaryrefslogtreecommitdiffstats
path: root/thirdparty/assimp/code/Common/DefaultIOStream.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-03-09 10:42:18 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-03-09 10:42:18 +0100
commitda1f80c1f2d71aeaee9f57fd19fc2ea4f76c487d (patch)
treee7f0d1caae79f594d43be8d5068a04c285e2c5bc /thirdparty/assimp/code/Common/DefaultIOStream.cpp
parent471271b727fd1dcc716a10f34e615ce61ca6d16e (diff)
downloadredot-engine-da1f80c1f2d71aeaee9f57fd19fc2ea4f76c487d.tar.gz
Revert "assimp: Sync with upstream 0201fc5"
This reverts commit 78b22393a8dd182ee56d0448ed77ba4430de5e75. It caused a regression in FBX import leading to crashes. Fixes #36908.
Diffstat (limited to 'thirdparty/assimp/code/Common/DefaultIOStream.cpp')
-rw-r--r--thirdparty/assimp/code/Common/DefaultIOStream.cpp35
1 files changed, 3 insertions, 32 deletions
diff --git a/thirdparty/assimp/code/Common/DefaultIOStream.cpp b/thirdparty/assimp/code/Common/DefaultIOStream.cpp
index 205f19e378..1c100b6189 100644
--- a/thirdparty/assimp/code/Common/DefaultIOStream.cpp
+++ b/thirdparty/assimp/code/Common/DefaultIOStream.cpp
@@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
-Copyright (c) 2006-2020, assimp team
+Copyright (c) 2006-2019, assimp team
@@ -52,35 +52,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using namespace Assimp;
-namespace
-{
- template<size_t sizeOfPointer>
- size_t select_ftell(FILE* file)
- {
- return ::ftell(file);
- }
-
- template<size_t sizeOfPointer>
- int select_fseek(FILE* file, int64_t offset, int origin)
- {
- return ::fseek(file, static_cast<long>(offset), origin);
- }
-
-#if defined _WIN32 && (!defined __GNUC__ || __MSVCRT_VERSION__ >= 0x0601)
- template<>
- size_t select_ftell<8>(FILE* file)
- {
- return ::_ftelli64(file);
- }
-
- template<>
- int select_fseek<8>(FILE* file, int64_t offset, int origin)
- {
- return ::_fseeki64(file, offset, origin);
- }
-#endif
-}
-
// ----------------------------------------------------------------------------------
DefaultIOStream::~DefaultIOStream()
{
@@ -122,7 +93,7 @@ aiReturn DefaultIOStream::Seek(size_t pOffset,
aiOrigin_END == SEEK_END && aiOrigin_SET == SEEK_SET");
// do the seek
- return (0 == select_fseek<sizeof(void*)>(mFile, (int64_t)pOffset,(int)pOrigin) ? AI_SUCCESS : AI_FAILURE);
+ return (0 == ::fseek(mFile, (long)pOffset,(int)pOrigin) ? AI_SUCCESS : AI_FAILURE);
}
// ----------------------------------------------------------------------------------
@@ -131,7 +102,7 @@ size_t DefaultIOStream::Tell() const
if (!mFile) {
return 0;
}
- return select_ftell<sizeof(void*)>(mFile);
+ return ::ftell(mFile);
}
// ----------------------------------------------------------------------------------