GNOME Bugzilla – Bug 728663
W32: wrong stat struct is used when built with MinGW-w64
Last modified: 2015-04-05 11:12:07 UTC
What some people don't quite get is that mingw-w64 supports LFS, and supported it for some time (a couple of years, roughly). LFS is controlled by an intricate set of macros, and there's a blog post[1] i did to explore and systematize this, but in a nutshell: normal autotooled software packages will end up using LFS, with "struct stat" having 64-bit st_size field, regardless of OS bitness, while time fields (an issue orthogonal to LFS) will be 32-bit on 32-bit OS and 64-bit on 64-bit OS. gstdio.h, as of March 2010, typedefs GStatBuf as "struct stat" instead of "struct _stat". Which means that GStatBuf will have LFS, if configure is used (I.e. glib is built in MSYS, or cross-compiled from GNU/Linux or Cygwin). "struct _stat" would not have had this problem, as it has 32-bit st_size field, always. This bug is a fork of bug 711547 (see [2]), i want it fixed soon'ish. [1] https://gnunet.org/content/sorting-out-stat-thing [2] https://bugzilla.gnome.org/show_bug.cgi?id=711547#c10
Created attachment 274814 [details] [review] Make sure GStatBuf is typedefed correctly
I have exactly zero opinion on this topic. Hopefully someone who knows more about Windows can contribute a useful opinion.
Review of attachment 274814 [details] [review]: I'd say let's get it in. This has been used downstream for the last 6 months or so.
Attachment 274814 [details] pushed as eac975c - Make sure GStatBuf is typedefed correctly