Skip to content

Commit

Permalink
Assimp: Fix compilation with MinGW10 (#6107)
Browse files Browse the repository at this point in the history
* Assimp: Fix compilation with MinGW10

assimp/assimp#5827

* Fix patch version

* Fix checksum

* Another patch fix

* Update xmake.lua
  • Loading branch information
SirLynix authored Jan 2, 2025
1 parent 72d7580 commit 2e23d55
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/a/assimp/patches/5.4.3/fix_mingw.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/code/Common/DefaultIOStream.cpp b/code/Common/DefaultIOStream.cpp
index e423eae4f8..35bbb67a5a 100644
--- a/code/Common/DefaultIOStream.cpp
+++ b/code/Common/DefaultIOStream.cpp
@@ -157,9 +157,9 @@ size_t DefaultIOStream::FileSize() const {
return 0;
mCachedSize = (size_t)(fileStat.st_size);
#elif defined _WIN32
- struct _stat32 fileStat;
+ struct _stat fileStat;
//using fileno + fstat avoids having to handle the filename
- int err = _fstat32(_fileno(mFile), &fileStat);
+ int err = _fstat(_fileno(mFile), &fileStat);
if (0 != err)
return 0;
mCachedSize = (size_t)(fileStat.st_size);
1 change: 1 addition & 0 deletions packages/a/assimp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package("assimp")
add_patches("v5.2.3", path.join(os.scriptdir(), "patches", "5.2.1", "fix_zlib_filefunc_def.patch"), "a9f8a9aa1975888ea751b80c8268296dee901288011eeb1addf518eac40b71b1")
add_patches("v5.2.3", path.join(os.scriptdir(), "patches", "5.2.3", "cmake_static_crt.patch"), "3872a69976055bed9e40814e89a24a3420692885b50e9f9438036e8d809aafb4")
add_patches("v5.2.4", path.join(os.scriptdir(), "patches", "5.2.4", "fix_x86_windows_build.patch"), "becb4039c220678cf1e888e3479f8e68d1964c49d58f14c5d247c86b4a5c3293")
add_patches("v5.4.3", path.join(os.scriptdir(), "patches", "5.4.3", "fix_mingw.patch"), "2498bb9438a0108becf1c514fcbfc103e012638914c9d21160572ed24a9fa3b3")

if not is_host("windows") then
add_extsources("pkgconfig::assimp")
Expand Down

0 comments on commit 2e23d55

Please sign in to comment.