win32: update to newer mingw compiler version.

This commit is contained in:
Sam Hocevar 2014-11-05 00:23:27 +00:00 committed by sam
parent aba365f2a5
commit 39f48f37d6
8 changed files with 53 additions and 12 deletions

View File

@ -17,7 +17,7 @@ mkdir "${BUILDDIR}"
cd "${BUILDDIR}"
# Build for win32
"${SRCDIR}/configure" --host=i586-mingw32msvc --prefix=/ --bindir=/ --libdir=/
"${SRCDIR}/configure" --host=i686-w64-mingw32 --prefix=/ --bindir=/ --libdir=/
make pkglibdir=/ pkgdatadir=/data bindir=/

View File

@ -78,6 +78,10 @@ AC_CHECK_TYPES(sig_t, [], [],
AC_CHECK_TYPES(socklen_t, [], [],
[#include <sys/types.h>
#include <sys/socket.h>])
AC_CHECK_TYPES(fpos64_t, [], [],
[#define _LARGEFILE64_SOURCE
#define _LARGEFILE_SOURCE
#include <stdio.h>])
AC_MSG_CHECKING(for connect() second argument)
AC_TRY_COMPILE([#include <sys/types.h>
@ -155,7 +159,7 @@ AC_TRY_COMPILE(
[fpos64_t x; long long int y = (long long int)x;],
[ac_v_fpos64_t="(x)"])
AC_MSG_RESULT($ac_v_fpos64_t)
AC_DEFINE_UNQUOTED(FPOS_CAST(x), $ac_v_fpos64_t, [Define to a macro for accessing an fpos64_t variable])
AC_DEFINE_UNQUOTED(FPOS64_CAST(x), $ac_v_fpos64_t, [Define to a macro for accessing an fpos64_t variable])
AC_MSG_CHECKING(for pragma INIT/FINI)
AC_TRY_COMPILE([],

View File

@ -43,6 +43,7 @@
/* #undef HAVE_FGETS_UNLOCKED */
/* #undef HAVE_FOPEN64 */
/* #undef HAVE_FORK */
/* #undef HAVE_FPOS64_T */
/* #undef HAVE_FREAD_UNLOCKED */
/* #undef HAVE_FREEBSD_FILE */
/* #undef HAVE_FREOPEN64 */

View File

@ -78,6 +78,8 @@
#if defined CONNECT_USES_STRUCT_SOCKADDR
# define SOCKADDR_T struct sockaddr
#elif defined HAVE_WINSOCK2_H
# define SOCKADDR_T struct sockaddr
#else
# define SOCKADDR_T void
#endif

View File

@ -52,6 +52,12 @@
#include "fuzz.h"
#include "fd.h"
#if defined HAVE_FPOS64_T
# define FPOS64_T fpos64_t
#else
# define FPOS64_T fpos_t
#endif
#if defined HAVE___SREFILL
#undef __srefill
int NEW(__srefill)(FILE *fp);
@ -101,10 +107,10 @@ static int (*ORIG(fseeko64)) (FILE *stream, off_t offset, int whence);
static int (*ORIG(__fseeko64)) (FILE *stream, off_t offset, int whence);
#endif
#if defined HAVE_FSETPOS64
static int (*ORIG(fsetpos64))(FILE *stream, const fpos64_t *pos);
static int (*ORIG(fsetpos64))(FILE *stream, const FPOS64_T *pos);
#endif
#if defined HAVE___FSETPOS64
static int (*ORIG(__fsetpos64)) (FILE *stream, const fpos64_t *pos);
static int (*ORIG(__fsetpos64)) (FILE *stream, const FPOS64_T *pos);
#endif
static void (*ORIG(rewind)) (FILE *stream);
static size_t (*ORIG(fread)) (void *ptr, size_t size, size_t nmemb,
@ -386,6 +392,12 @@ FILE *NEW(__freopen64)(const char *path, const char *mode, FILE *stream)
fd, (long long int)offset, get_seek_mode_name(whence), ret); \
} while(0)
#if HAVE_FPOS64_T
# define FPOS_T_TO_INT64_T(x) ((int64_t)FPOS64_CAST(x))
#else
# define FPOS_T_TO_INT64_T(x) ((int64_t)(x))
#endif
#define ZZ_FSETPOS(myfsetpos) \
do \
{ \
@ -412,10 +424,10 @@ FILE *NEW(__freopen64)(const char *path, const char *mode, FILE *stream)
_zz_fuzz(fd, get_stream_ptr(stream) - get_stream_off(stream), \
get_stream_cnt(stream) + get_stream_off(stream)); \
} \
_zz_setpos(fd, (int64_t)FPOS_CAST(*pos)); \
_zz_setpos(fd, FPOS_T_TO_INT64_T(*pos)); \
debug_stream("after", stream); \
debug("%s([%i], %lli) = %i", __func__, \
fd, (long long int)FPOS_CAST(*pos), ret); \
fd, (long long int)FPOS_T_TO_INT64_T(*pos), ret); \
} \
while(0)
@ -482,7 +494,7 @@ int NEW(__fseeko64)(FILE *stream, off64_t offset, int whence)
#if defined HAVE_FSETPOS64
#undef fsetpos64
int NEW(fsetpos64)(FILE *stream, const fpos64_t *pos)
int NEW(fsetpos64)(FILE *stream, const FPOS64_T *pos)
{
int ret; ZZ_FSETPOS(fsetpos64); return ret;
}
@ -490,7 +502,7 @@ int NEW(fsetpos64)(FILE *stream, const fpos64_t *pos)
#if defined HAVE___FSETPOS64
#undef __fsetpos64
int NEW(__fsetpos64)(FILE *stream, const fpos64_t *pos)
int NEW(__fsetpos64)(FILE *stream, const FPOS64_T *pos)
{
int ret; ZZ_FSETPOS(__fsetpos64); return ret;
}

View File

@ -424,17 +424,39 @@ BOOL __stdcall NEW(WriteConsoleOutputW)(HANDLE hConsoleOutput,
zzuf_table_t table_win32[] =
{
#if defined HAVE_CLOSEHANDLE
DIVERT(CloseHandle),
#endif
#if defined HAVE_CREATEFILEA
DIVERT(CreateFileA),
#endif
#if defined HAVE_CREATEFILEW
DIVERT(CreateFileW),
#endif
#if defined HAVE_READFILE
DIVERT(ReadFile),
#endif
#if defined HAVE_READFILEEX
DIVERT(ReadFileEx),
#endif
#if defined HAVE_CREATEIOCOMPLETIONPORT
DIVERT(CreateIoCompletionPort),
#endif
#if defined HAVE_GETQUEUEDCOMPLETIONSTATUS
DIVERT(GetQueuedCompletionStatus),
#endif
#if defined HAVE_GETOVERLAPPEDRESULT
DIVERT(GetOverlappedResult),
#endif
#if defined HAVE_CREATEFILEMAPPINGA
DIVERT(CreateFileMappingA),
#endif
#if defined HAVE_CREATEFILEMAPPINGW
DIVERT(CreateFileMappingW),
#endif
#ifdef HAVE_MAPVIEWOFFILE
DIVERT(MapViewOfFile),
#endif
#if defined HAVE_ALLOCCONSOLE
DIVERT(AllocConsole),

View File

@ -37,6 +37,6 @@ extern void _zz_fini(void) __attribute__((destructor));
extern void _zz_mem_init(void);
#ifdef _WIN32
# include <Windows.h>
# include <windows.h>
extern CRITICAL_SECTION _zz_pipe_cs;
#endif
#endif

View File

@ -29,8 +29,8 @@
# include <netinet/in.h>
# include <arpa/inet.h>
#elif defined HAVE_WINSOCK2_H
# include <WinSock2.h>
# include <WS2tcpip.h>
# include <winsock2.h>
# include <ws2tcpip.h>
#endif
#include "libzzuf.h"