• Christoph Reiter's avatar
    gstdio: use _stat64 for GStatBuf on 64bit mingw. Fixes #1476 · 63d3311c
    Christoph Reiter authored
    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.
    63d3311c
gstdio.h 4.83 KB