Fixed MinGW header bug where off_t/off64_t is not defined in io.h

(See http://sourceforge.net/p/mingw/bugs/2024/)
This commit is contained in:
Snaipe 2015-10-01 15:38:24 +02:00
parent 55553a0681
commit d4c306f7cd
2 changed files with 16 additions and 0 deletions

View file

@ -30,7 +30,15 @@
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0502
# include <windows.h>
# if defined(__MINGW32__) || defined(__MINGW64__)
# define off_t _off_t
# define off64_t _off64_t
# endif
# include <io.h>
# if defined(__MINGW32__) || defined(__MINGW64__)
# undef off_t
# undef off64_t
# endif
# include <fcntl.h>
# include <winnt.h>
# include <stdint.h>

View file

@ -40,7 +40,15 @@
# define _POSIX_SOURCE 1
# define TMP_POSIX
# endif
# if defined(__MINGW32__) || defined(__MINGW64__)
# define off_t _off_t
# define off64_t _off64_t
# endif
# include <stdio.h>
# if defined(__MINGW32__) || defined(__MINGW64__)
# undef off_t
# undef off64_t
# endif
# ifdef TMP_POSIX
# undef _POSIX_SOURCE
# undef TMP_POSIX