gstdio: use _stat64 for GStatBuf on 64bit mingw. Fixes #147663d3311c26bac57fa574957c3bdc24ae6217d1e0226/head
commit63d3311c26bac57fa574957c3bdc24ae6217d1e0
authorChristoph Reiter <reiter.christoph@gmail.com>
Sun, 5 Aug 2018 09:21:26 +0000 (5 11:21 +0200)
committerChristoph Reiter <reiter.christoph@gmail.com>
Mon, 20 Aug 2018 10:40:21 +0000 (20 12:40 +0200)
treebae79ada779ff6f0ae533a36ac396dbe944d5149
parent373613935840e9811786843af205449184aef06e
gstdio: use _stat64 for GStatBuf on 64bit mingw. Fixes #1476

The size of stat depends on various macros on Windows which leads to
the problem of size mismatches when glib is built with a different configuration
than a program using it.

For example the autotools build defaults to _FILE_OFFSET_BITS=64 and a program
not defining  _FILE_OFFSET_BITS will allocate a too small struct on the stack,
leading to stack corruption when glib writes to it.

To make the size the user sees always match the default mingw build define GStatBuf
as _stat64 (same as _FILE_OFFSET_BITS=64) under mingw+64bit.
NEWS
glib/gstdio.h