I'm use Win7 x64, GCC version 4.9.2 (x86_64-win32-seh-rev1, Built by MinGW-W64 project)
but _FILE_OFFSET_BITS defined only in lprefix.h and no longer used anywhere. Аs I understand, the problem in this:
/* liolib.c */
#elif defined(LUA_USE_WINDOWS) && !defined(_CRTIMP_TYPEINFO) \
&& defined(_MSC_VER) && (_MSC_VER >= 1400) /* }{ */
/* Windows (but not DDK) and Visual C++ 2005 or higher */
#define l_fseek(f,o,w) _fseeki64(f,o,w)
#define l_ftell(f) _ftelli64(f)
#define l_seeknum __int64
#else /* }{ */
/* ISO C definitions */
#define l_fseek(f,o,w) fseek(f,o,w)
#define l_ftell(f) ftell(f)
#define l_seeknum long
#endif /* } */
If I define _MSC_VER, it is utilized the 64-bit functions, MinGW can use them, but not by default.