--- qemu-1.0/block/vvfat.c.orig 2011-12-01 21:07:34.000000000 +0100 +++ qemu-1.0/block/vvfat.c 2012-01-30 10:05:41.047320600 +0100 @@ -821,7 +821,13 @@ static inline uint32_t sector2cluster(BDRVVVFATState* s,off_t sector_num) { - return (sector_num-s->faked_sectors)/s->sectors_per_cluster; + uint32_t ret; + + if (sector_num < s->faked_sectors) + ret = 0; + else + ret = (sector_num-s->faked_sectors)/s->sectors_per_cluster; + return ret; } static inline off_t cluster2sector(BDRVVVFATState* s, uint32_t cluster_num) --- qemu-1.0/config-host.mak.orig 2012-01-30 10:18:09.595093000 +0100 +++ qemu-1.0/config-host.mak 2012-01-31 17:26:58.984443900 +0100 @@ -1,5 +1,5 @@ # Automatically generated by configure - do not modify -# Configured with: './configure' '--target-list=i386-softmmu arm-softmmu sparc-softmmu ppc-softmmu x86_64-softmmu' '--cc=gcc -mno-cygwin' '--host-cc=gcc' '--audio-drv-list=dsound sdl fmod' '--audio-card-list=ac97 es1370 sb16 cs4231a adlib gus' '--prefix=/home/lassauge/MyDocuments/Qemu-windows' '--fmod-lib=/home/lassauge/Qemu/fmodapi375win/api/lib/libfmod.a' '--fmod-inc=/home/lassauge/Qemu/fmodapi375win/api/inc' '--disable-vnc-png' '--disable-vnc-jpeg' +# Configured with: './configure' '--target-list=i386-softmmu arm-softmmu sparc-softmmu ppc-softmmu x86_64-softmmu' '--cc=i586-mingw32-gcc' '--host-cc=/usr/bin/gcc' '--audio-drv-list=dsound sdl fmod' '--audio-card-list=ac97 es1370 sb16 cs4231a adlib gus' '--prefix=/home/lassauge/MyDocuments/Qemu-windows' '--fmod-lib=/home/lassauge/Qemu/fmodapi375win/api/lib/libfmod.a' '--fmod-inc=/home/lassauge/Qemu/fmodapi375win/api/inc' '--enable-pie' '--disable-vnc-jpeg' '--disable-strip' all: prefix=/home/lassauge/MyDocuments/Qemu-windows bindir=${prefix} @@ -11,7 +11,6 @@ docdir=${prefix} confdir=${prefix} ARCH=i386 -STRIP=strip HOST_LONG_BITS=32 CONFIG_WIN32=y CONFIG_FILEVERSION=1,0,0,0 @@ -32,20 +31,21 @@ CONFIG_AUDIO_WIN_INT=y CONFIG_BDRV_WHITELIST= CONFIG_VNC=y +CONFIG_VNC_PNG=y +VNC_PNG_CFLAGS=-Id:/MinGW/include/libpng14 VERSION=1.0 PKGVERSION= SRC_PATH=/home/lassauge/Qemu/qemu-1.0 TARGET_DIRS=i386-softmmu arm-softmmu sparc-softmmu ppc-softmmu x86_64-softmmu BUILD_DOCS=yes CONFIG_SDL=y -SDL_CFLAGS=-mno-cygwin -Dmain=SDL_main -I/usr/include/mingw/SDL -I/usr/include/mingw -GLIB_CFLAGS=-D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include +SDL_CFLAGS=-Id:/MinGW/include/SDL -D_GNU_SOURCE=1 -Dmain=SDL_main +GLIB_CFLAGS=-mms-bitfields -Id:/MinGW/include/glib-2.0 -Id:/MinGW/lib/glib-2.0/include INSTALL_BLOBS=yes CONFIG_SMARTCARD=y CONFIG_UNAME_RELEASE="" CONFIG_ZERO_MALLOC=y HOST_USB=stub -LIBUSB_LIBS= TRACE_BACKEND=nop CONFIG_TRACE_NOP=y CONFIG_TRACE_FILE=trace @@ -59,25 +59,25 @@ INSTALL_DATA=install -c -m 0644 INSTALL_PROG=install -c -m 0755 PYTHON=python -CC=gcc -mno-cygwin +CC=i586-mingw32-gcc CC_I386=$(CC) -m32 -HOST_CC=gcc +HOST_CC=/usr/bin/gcc AR=ar OBJCOPY=objcopy LD=ld WINDRES=windres LIBTOOL=libtool -CFLAGS=-O4 -O4 -march=i686 -QEMU_CFLAGS=-m32 -D__USE_MINGW_ANSI_STDIO=1 -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -Wendif-labels -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wold-style-definition +CFLAGS=-O4 -march=i686 +QEMU_CFLAGS=-fPIE -DPIE -m32 -D__USE_MINGW_ANSI_STDIO=1 -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fstack-protector-all -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -Id:/MinGW/include/libpng14 QEMU_INCLUDES=-I$(SRC_PATH)/slirp -I. -I$(SRC_PATH) -I$(SRC_PATH)/fpu HELPER_CFLAGS=-fomit-frame-pointer -LDFLAGS=-Wl,--warn-common -m32 +LDFLAGS=-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase -Wl,--warn-common -pie -m32 ARLIBS_BEGIN= ARLIBS_END= -LIBS+=-lgthread-2.0 -lglib-2.0 -lintl -liconv -lwinmm -lws2_32 -liberty -liphlpapi $(LIBUSB_LIBS) +LIBS+=-lpthread -Ld:/MinGW/lib -lgthread-2.0 -lglib-2.0 -lintl -lwinmm -lws2_32 -liberty -liphlpapi LIBS_TOOLS+= EXESUF=.exe -LIBS_QGA+=-lgthread-2.0 -lglib-2.0 -lintl -liconv +LIBS_QGA+=-Ld:/MinGW/lib -lgthread-2.0 -lglib-2.0 -lintl subdir-i386-softmmu: subdir-libhw64 subdir-arm-softmmu: subdir-libhw32 subdir-sparc-softmmu: subdir-libhw64 --- qemu-1.0/configure.orig 2011-12-01 21:07:34.000000000 +0100 +++ qemu-1.0/configure 2012-01-31 13:40:12.589383900 +0100 @@ -235,13 +235,13 @@ # default flags for all hosts QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" -CFLAGS="-g $CFLAGS" +CFLAGS="$CFLAGS" QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu" -LDFLAGS="-g $LDFLAGS" +LDFLAGS="$LDFLAGS" # make source path absolute source_path=`cd "$source_path"; pwd` @@ -353,7 +353,7 @@ CYGWIN*) mingw32="yes" QEMU_CFLAGS="-mno-cygwin $QEMU_CFLAGS" - audio_possible_drivers="winwave sdl" + audio_possible_drivers="winwave dsound sdl fmod" audio_drv_list="winwave" ;; MINGW32*) --- qemu-1.0/Makefile.orig 2011-12-01 21:07:34.000000000 +0100 +++ qemu-1.0/Makefile 2012-01-31 17:27:09.437568900 +0100 @@ -122,7 +122,7 @@ bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS) version.o: $(SRC_PATH)/version.rc config-host.h - $(call quiet-command,$(WINDRES) -I. -o $@ $<," RC $(TARGET_DIR)$@") + $(call quiet-command,$(WINDRES) -I. -o $@ '$(shell cygpath -w $<)'," RC $(TARGET_DIR)$@") version-obj-$(CONFIG_WIN32) += version.o ###################################################################### @@ -390,4 +390,4 @@ rm -rf /tmp/$(FILE) # Include automatically generated dependency files --include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d) +#-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d) --- qemu-1.0/qemu-char.c.orig 2011-12-01 21:07:34.000000000 +0100 +++ qemu-1.0/qemu-char.c 2012-01-30 10:05:41.078570600 +0100 @@ -514,6 +514,12 @@ return len1 - len; } +static CharDriverState *qemu_chr_open_fd(int fd_in, int fd_out) +{ + /* NOT AVAILABLE */ + return NULL; +} + #else int send_all(int fd, const void *_buf, int len1) @@ -536,6 +542,7 @@ } return len1 - len; } + #endif /* !_WIN32 */ #define STDIO_MAX_CLIENTS 1 --- qemu-1.0/qemu_socket.h.orig 2011-12-01 21:07:34.000000000 +0100 +++ qemu-1.0/qemu_socket.h 2012-01-30 10:05:41.078570600 +0100 @@ -12,6 +12,7 @@ #define EWOULDBLOCK WSAEWOULDBLOCK #define EINTR WSAEINTR #define EINPROGRESS WSAEINPROGRESS +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL int inet_aton(const char *cp, struct in_addr *ia); --- qemu-1.0/ui/vnc-enc-tight.c.orig 2011-12-01 21:07:34.000000000 +0100 +++ qemu-1.0/ui/vnc-enc-tight.c 2012-01-30 10:05:41.109820600 +0100 @@ -50,6 +50,8 @@ #include "vnc-enc-tight.h" #include "vnc-palette.h" +typedef unsigned int uint; + /* Compression level stuff. The following array contains various encoder parameters for each of 10 compression levels (0..9). Last three parameters correspond to JPEG quality levels (0..9). */