All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches
@ 2014-03-20  6:25 Stefan Weil
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 1/5] gtk: Support GTK without VTE Stefan Weil
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Stefan Weil @ 2014-03-20  6:25 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

This includes a patch for GTK (needed for MinGW, but not restricted to it)
and most of the patches which restructure the includes for the Win API.
I ommitted the last optional block patch.

Stefan

[PULL for 2.0 1/5] gtk: Support GTK without VTE
[PULL for 2.0 2/5] w32: Add and use intermediate include file for
[PULL for 2.0 3/5] w32: Move inline function from header file to C
[PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h
[PULL for 2.0 5/5] w32: Replace Windows specific data types in

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL for 2.0 1/5] gtk: Support GTK without VTE
  2014-03-20  6:25 [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
@ 2014-03-20  6:25 ` Stefan Weil
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 2/5] w32: Add and use intermediate include file for windows.h Stefan Weil
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Stefan Weil @ 2014-03-20  6:25 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Stefan Weil, qemu-devel

GTK without VTE is needed for hosts which don't support VTE (for example
all variants of MinGW), but it can also be reasonable for other hosts.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 configure |   54 +++++++++++++++++++++++++++++++++++++-----------------
 ui/gtk.c  |   17 ++++++++++++++++-
 2 files changed, 53 insertions(+), 18 deletions(-)

diff --git a/configure b/configure
index aae617e..5eaa802 100755
--- a/configure
+++ b/configure
@@ -318,6 +318,7 @@ glusterfs_zerofill="no"
 virtio_blk_data_plane=""
 gtk=""
 gtkabi="2.0"
+vte=""
 tpm="no"
 libssh2=""
 vhdx=""
@@ -1063,6 +1064,10 @@ for opt do
   ;;
   --with-gtkabi=*) gtkabi="$optarg"
   ;;
+  --disable-vte) vte="no"
+  ;;
+  --enable-vte) vte="yes"
+  ;;
   --enable-tpm) tpm="yes"
   ;;
   --disable-libssh2) libssh2="no"
@@ -1946,30 +1951,41 @@ if test "$gtk" != "no"; then
     gtkpackage="gtk+-$gtkabi"
     if test "$gtkabi" = "3.0" ; then
       gtkversion="3.0.0"
+    else
+      gtkversion="2.18.0"
+    fi
+    if $pkg_config --exists "$gtkpackage >= $gtkversion"; then
+        gtk_cflags=`$pkg_config --cflags $gtkpackage`
+        gtk_libs=`$pkg_config --libs $gtkpackage`
+        libs_softmmu="$gtk_libs $libs_softmmu"
+        gtk="yes"
+    elif test "$gtk" = "yes"; then
+        feature_not_found "gtk" "Install gtk2 or gtk3 (requires --with-gtkabi=3.0 option to configure) devel"
+    else
+        gtk="no"
+    fi
+fi
+
+##########################################
+# VTE probe
+
+if test "$vte" != "no"; then
+    if test "$gtkabi" = "3.0"; then
       vtepackage="vte-2.90"
       vteversion="0.32.0"
     else
-      gtkversion="2.18.0"
       vtepackage="vte"
       vteversion="0.24.0"
     fi
-    if ! $pkg_config --exists "$gtkpackage >= $gtkversion"; then
-        if test "$gtk" = "yes" ; then
-            feature_not_found "gtk" "Install gtk2 or gtk3 (requires --with-gtkabi=3.0 option to configure) devel"
-        fi
-        gtk="no"
-    elif ! $pkg_config --exists "$vtepackage >= $vteversion"; then
-        if test "$gtk" = "yes" ; then
-            error_exit "libvte not found (required for gtk support)"
-        fi
-        gtk="no"
+    if $pkg_config --exists "$vtepackage >= $vteversion"; then
+        vte_cflags=`$pkg_config --cflags $vtepackage`
+        vte_libs=`$pkg_config --libs $vtepackage`
+        libs_softmmu="$vte_libs $libs_softmmu"
+        vte="yes"
+    elif test "$vte" = "yes"; then
+        feature_not_found "vte" "Install libvte or libvte-2.90 (requires --with-gtkabi=3.0 option to configure) devel"
     else
-	gtk_cflags=`$pkg_config --cflags $gtkpackage`
-	gtk_libs=`$pkg_config --libs $gtkpackage`
-	vte_cflags=`$pkg_config --cflags $vtepackage`
-	vte_libs=`$pkg_config --libs $vtepackage`
-	libs_softmmu="$gtk_libs $vte_libs $libs_softmmu"
-	gtk="yes"
+        vte="no"
     fi
 fi
 
@@ -4053,6 +4069,7 @@ fi
 echo "pixman            $pixman"
 echo "SDL support       $sdl"
 echo "GTK support       $gtk"
+echo "VTE support       $vte"
 echo "curses support    $curses"
 echo "curl support      $curl"
 echo "mingw32 support   $mingw32"
@@ -4381,6 +4398,9 @@ echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
 if test "$gtk" = "yes" ; then
   echo "CONFIG_GTK=y" >> $config_host_mak
   echo "GTK_CFLAGS=$gtk_cflags" >> $config_host_mak
+fi
+if test "$vte" = "yes" ; then
+  echo "CONFIG_VTE=y" >> $config_host_mak
   echo "VTE_CFLAGS=$vte_cflags" >> $config_host_mak
 fi
 if test "$xen" = "yes" ; then
diff --git a/ui/gtk.c b/ui/gtk.c
index baabf86..f056e40 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -54,7 +54,9 @@
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n.h>
 #include <locale.h>
+#if defined(CONFIG_VTE)
 #include <vte/vte.h>
+#endif
 #include <math.h>
 
 #include "trace.h"
@@ -68,6 +70,9 @@
 
 #define MAX_VCS 10
 
+#if !defined(CONFIG_VTE)
+# define VTE_CHECK_VERSION(a, b, c) 0
+#endif
 
 /* Compatibility define to let us build on both Gtk2 and Gtk3 */
 #if GTK_CHECK_VERSION(3, 0, 0)
@@ -105,8 +110,10 @@ typedef struct VirtualConsole
 {
     GtkWidget *menu_item;
     GtkWidget *terminal;
+#if defined(CONFIG_VTE)
     GtkWidget *scrolled_window;
     CharDriverState *chr;
+#endif
     int fd;
 } VirtualConsole;
 
@@ -1063,6 +1070,7 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
     if (arg2 == 0) {
         gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->vga_item), TRUE);
     } else {
+#if defined(CONFIG_VTE)
         VirtualConsole *vc = &s->vc[arg2 - 1];
         VteTerminal *term = VTE_TERMINAL(vc->terminal);
         int width, height;
@@ -1072,6 +1080,9 @@ static void gd_change_page(GtkNotebook *nb, gpointer arg1, guint arg2,
 
         gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(vc->menu_item), TRUE);
         gtk_widget_set_size_request(vc->terminal, width, height);
+#else
+        g_assert_not_reached();
+#endif
     }
 
     gtk_widget_set_sensitive(s->grab_item, on_vga);
@@ -1117,7 +1128,7 @@ static int gd_vc_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
 {
     VirtualConsole *vc = chr->opaque;
 
-    return write(vc->fd, buf, len);
+    return vc ? write(vc->fd, buf, len) : len;
 }
 
 static int nb_vcs;
@@ -1142,6 +1153,7 @@ void early_gtk_display_init(void)
     register_vc_handler(gd_vc_handler);
 }
 
+#if defined(CONFIG_VTE)
 static gboolean gd_vc_in(GIOChannel *chan, GIOCondition cond, void *opaque)
 {
     VirtualConsole *vc = opaque;
@@ -1157,10 +1169,12 @@ static gboolean gd_vc_in(GIOChannel *chan, GIOCondition cond, void *opaque)
 
     return TRUE;
 }
+#endif
 
 static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSList *group,
                           GtkWidget *view_menu)
 {
+#if defined(CONFIG_VTE)
     const char *label;
     char buffer[32];
     char path[32];
@@ -1230,6 +1244,7 @@ static GSList *gd_vc_init(GtkDisplayState *s, VirtualConsole *vc, int index, GSL
     chan = g_io_channel_unix_new(vc->fd);
     g_io_add_watch(chan, G_IO_IN, gd_vc_in, vc);
 
+#endif /* CONFIG_VTE */
     return group;
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL for 2.0 2/5] w32: Add and use intermediate include file for windows.h
  2014-03-20  6:25 [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 1/5] gtk: Support GTK without VTE Stefan Weil
@ 2014-03-20  6:25 ` Stefan Weil
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 3/5] w32: Move inline function from header file to C source Stefan Weil
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Stefan Weil @ 2014-03-20  6:25 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Kevin Wolf, Stefan Hajnoczi, Stefan Weil, qemu-devel,
	Gerd Hoffmann, Anthony Liguori, Jan Kiszka

Including windows.h from the new file include/qemu/winapi.h allows
better tracking of the files which depend on the Windows API.

1864 *.o files depend on windows.h in a typical build, only 88 *.o files
don't.

The windows.h specific macro WIN32_LEAN_AND_MEAN is now defined in the new
file and no longer part of the QEMU_CFLAGS. A hack in ui/sdl.c can be
removed after this change.

WINVER is still needed for all compilations with MinGW, so it cannot be
defined in the new file. Replace its numeric value by a symbolic value to
show which API is requested.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Anthony Liguori <aliguori@amazon.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 audio/audio_win_int.c         |    2 +-
 audio/dsoundaudio.c           |    2 +-
 audio/winwaveaudio.c          |    2 +-
 block.c                       |    2 +-
 block/raw-win32.c             |    2 +-
 block/win32-aio.c             |    2 +-
 configure                     |    2 +-
 include/qemu/event_notifier.h |    2 +-
 include/qemu/sockets.h        |    2 +-
 include/qemu/thread-win32.h   |    2 +-
 include/qemu/winapi.h         |   22 ++++++++++++++++++++++
 include/sysemu/os-win32.h     |    2 +-
 net/tap-win32.c               |    2 +-
 os-win32.c                    |    2 +-
 qga/channel-win32.c           |    2 +-
 qga/commands-win32.c          |    2 +-
 qga/service-win32.c           |    2 +-
 qga/service-win32.h           |    2 +-
 qga/vss-win32.c               |    2 +-
 qga/vss-win32/vss-common.h    |    2 +-
 slirp/slirp.h                 |    2 +-
 translate-all.c               |    2 +-
 ui/sdl.c                      |    3 ---
 util/oslib-win32.c            |    2 +-
 24 files changed, 44 insertions(+), 25 deletions(-)
 create mode 100644 include/qemu/winapi.h

diff --git a/audio/audio_win_int.c b/audio/audio_win_int.c
index e132405..0e9f2a4 100644
--- a/audio/audio_win_int.c
+++ b/audio/audio_win_int.c
@@ -3,7 +3,7 @@
 #include "qemu-common.h"
 
 #define AUDIO_CAP "win-int"
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <mmsystem.h>
 
 #include "audio.h"
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index e2d89fd..cf779bf 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -32,7 +32,7 @@
 #define AUDIO_CAP "dsound"
 #include "audio_int.h"
 
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <mmsystem.h>
 #include <objbase.h>
 #include <dsound.h>
diff --git a/audio/winwaveaudio.c b/audio/winwaveaudio.c
index 8dbd145..f11f5ba 100644
--- a/audio/winwaveaudio.c
+++ b/audio/winwaveaudio.c
@@ -7,7 +7,7 @@
 #define AUDIO_CAP "winwave"
 #include "audio_int.h"
 
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <mmsystem.h>
 
 #include "audio_win_int.h"
diff --git a/block.c b/block.c
index acb70fd..8d308c1 100644
--- a/block.c
+++ b/block.c
@@ -47,7 +47,7 @@
 #endif
 
 #ifdef _WIN32
-#include <windows.h>
+#include "qemu/winapi.h"
 #endif
 
 struct BdrvDirtyBitmap {
diff --git a/block/raw-win32.c b/block/raw-win32.c
index 48cb2c2..1ac9137 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -23,13 +23,13 @@
  */
 #include "qemu-common.h"
 #include "qemu/timer.h"
+#include "qemu/winapi.h"        /* HANDLE (in raw-aio.h) */
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "raw-aio.h"
 #include "trace.h"
 #include "block/thread-pool.h"
 #include "qemu/iov.h"
-#include <windows.h>
 #include <winioctl.h>
 
 #define FTYPE_FILE 0
diff --git a/block/win32-aio.c b/block/win32-aio.c
index 5d1d199..dbcc6bc 100644
--- a/block/win32-aio.c
+++ b/block/win32-aio.c
@@ -23,13 +23,13 @@
  */
 #include "qemu-common.h"
 #include "qemu/timer.h"
+#include "qemu/winapi.h"        /* HANDLE (in raw-aio.h) */
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "block/aio.h"
 #include "raw-aio.h"
 #include "qemu/event_notifier.h"
 #include "qemu/iov.h"
-#include <windows.h>
 #include <winioctl.h>
 
 #define FTYPE_FILE 0
diff --git a/configure b/configure
index 5eaa802..244ad17 100755
--- a/configure
+++ b/configure
@@ -670,7 +670,7 @@ fi
 if test "$mingw32" = "yes" ; then
   EXESUF=".exe"
   DSOSUF=".dll"
-  QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS"
+  QEMU_CFLAGS="-DWINVER=_WIN32_WINNT_WINXP $QEMU_CFLAGS"
   # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later)
   QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS"
   LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
diff --git a/include/qemu/event_notifier.h b/include/qemu/event_notifier.h
index 88b57af..bdca689 100644
--- a/include/qemu/event_notifier.h
+++ b/include/qemu/event_notifier.h
@@ -16,7 +16,7 @@
 #include "qemu-common.h"
 
 #ifdef _WIN32
-#include <windows.h>
+#include "qemu/winapi.h"
 #endif
 
 struct EventNotifier {
diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 45588d7..a41d453 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -3,7 +3,7 @@
 #define QEMU_SOCKET_H
 
 #ifdef _WIN32
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <winsock2.h>
 #include <ws2tcpip.h>
 
diff --git a/include/qemu/thread-win32.h b/include/qemu/thread-win32.h
index 3d58081..7ade61a 100644
--- a/include/qemu/thread-win32.h
+++ b/include/qemu/thread-win32.h
@@ -1,6 +1,6 @@
 #ifndef __QEMU_THREAD_WIN32_H
 #define __QEMU_THREAD_WIN32_H 1
-#include "windows.h"
+#include "qemu/winapi.h"
 
 struct QemuMutex {
     CRITICAL_SECTION lock;
diff --git a/include/qemu/winapi.h b/include/qemu/winapi.h
new file mode 100644
index 0000000..d4cfaaa
--- /dev/null
+++ b/include/qemu/winapi.h
@@ -0,0 +1,22 @@
+/*
+ * QEMU interface to the Windows API
+ *
+ * Copyright (c) 2014 Stefan Weil
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2
+ * or later.  See the COPYING file in the top-level directory.
+ */
+
+#ifndef QEMU_WINAPI_H
+#define QEMU_WINAPI_H
+
+/* Don't include some less frequently used APIs. */
+#define WIN32_LEAN_AND_MEAN
+
+#if !defined(WINVER)
+# error Add -DWINVER=_WIN32_WINNT_WINXP to compiler options
+#endif
+
+#include <windows.h>
+
+#endif /* QEMU_WINAPI_H */
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index bf8523a..1d6494a 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -26,7 +26,7 @@
 #ifndef QEMU_OS_WIN32_H
 #define QEMU_OS_WIN32_H
 
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <winsock2.h>
 
 /* Workaround for older versions of MinGW. */
diff --git a/net/tap-win32.c b/net/tap-win32.c
index 8aee611..52e6143 100644
--- a/net/tap-win32.c
+++ b/net/tap-win32.c
@@ -35,7 +35,7 @@
 #include "sysemu/sysemu.h"
 #include "qemu/error-report.h"
 #include <stdio.h>
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <winioctl.h>
 
 //=============
diff --git a/os-win32.c b/os-win32.c
index 5f95caa..f6ec112 100644
--- a/os-win32.c
+++ b/os-win32.c
@@ -22,7 +22,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <mmsystem.h>
 #include <unistd.h>
 #include <fcntl.h>
diff --git a/qga/channel-win32.c b/qga/channel-win32.c
index 0d5e5f5..25c3257 100644
--- a/qga/channel-win32.c
+++ b/qga/channel-win32.c
@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <stdbool.h>
 #include <glib.h>
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <errno.h>
 #include <io.h>
 #include "qga/guest-agent-core.h"
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 0ee07b6..48cc819 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -11,8 +11,8 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/winapi.h" /* OpenProcessToken, ... */
 #include <glib.h>
-#include <wtypes.h>
 #include <powrprof.h>
 #include "qga/guest-agent-core.h"
 #include "qga/vss-win32.h"
diff --git a/qga/service-win32.c b/qga/service-win32.c
index aef41f0..b22ae67 100644
--- a/qga/service-win32.c
+++ b/qga/service-win32.c
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <glib.h>
-#include <windows.h>
+#include "qemu/winapi.h"
 #include "qga/service-win32.h"
 
 static int printf_win_error(const char *text)
diff --git a/qga/service-win32.h b/qga/service-win32.h
index 3b9e870..bd401f2 100644
--- a/qga/service-win32.h
+++ b/qga/service-win32.h
@@ -13,7 +13,7 @@
 #ifndef QGA_SERVICE_H
 #define QGA_SERVICE_H
 
-#include <windows.h>
+#include "qemu/winapi.h"
 
 #define QGA_SERVICE_DISPLAY_NAME "QEMU Guest Agent"
 #define QGA_SERVICE_NAME         "qemu-ga"
diff --git a/qga/vss-win32.c b/qga/vss-win32.c
index 24c4288..c6970d2 100644
--- a/qga/vss-win32.c
+++ b/qga/vss-win32.c
@@ -11,7 +11,7 @@
  */
 
 #include <stdio.h>
-#include <windows.h>
+#include "qemu/winapi.h"
 #include "qga/guest-agent-core.h"
 #include "qga/vss-win32.h"
 #include "qga/vss-win32/requester.h"
diff --git a/qga/vss-win32/vss-common.h b/qga/vss-win32/vss-common.h
index ce14e14..9768c1e 100644
--- a/qga/vss-win32/vss-common.h
+++ b/qga/vss-win32/vss-common.h
@@ -15,7 +15,7 @@
 
 #define __MIDL_user_allocate_free_DEFINED__
 #include "config-host.h"
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <shlwapi.h>
 
 /* Reduce warnings to include vss.h */
diff --git a/slirp/slirp.h b/slirp/slirp.h
index e4a1bd4..bb25ab9 100644
--- a/slirp/slirp.h
+++ b/slirp/slirp.h
@@ -9,7 +9,7 @@
 
 typedef char *caddr_t;
 
-# include <windows.h>
+# include "qemu/winapi.h"
 # include <winsock2.h>
 # include <ws2tcpip.h>
 # include <sys/timeb.h>
diff --git a/translate-all.c b/translate-all.c
index f243c10..7d9e9d8 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -17,7 +17,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #ifdef _WIN32
-#include <windows.h>
+#include "qemu/winapi.h"
 #else
 #include <sys/types.h>
 #include <sys/mman.h>
diff --git a/ui/sdl.c b/ui/sdl.c
index 4e7f920..e0bdebf 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -22,9 +22,6 @@
  * THE SOFTWARE.
  */
 
-/* Avoid compiler warning because macro is redefined in SDL_syswm.h. */
-#undef WIN32_LEAN_AND_MEAN
-
 #include <SDL.h>
 
 #if SDL_MAJOR_VERSION == 1
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 93f7d35..3fbe72a 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -25,7 +25,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <windows.h>
+#include "qemu/winapi.h"
 #include <glib.h>
 #include <stdlib.h>
 #include "config-host.h"
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL for 2.0 3/5] w32: Move inline function from header file to C source
  2014-03-20  6:25 [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 1/5] gtk: Support GTK without VTE Stefan Weil
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 2/5] w32: Add and use intermediate include file for windows.h Stefan Weil
@ 2014-03-20  6:25 ` Stefan Weil
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h Stefan Weil
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Stefan Weil @ 2014-03-20  6:25 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Stefan Weil, qemu-devel

A lot of files depend on qemu/timer.h. We don't want that all these files
depend on windows.h, too.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 include/qemu/timer.h     |    8 +-------
 util/qemu-timer-common.c |   11 ++++++++++-
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 7f9a074..19316b7 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -712,14 +712,8 @@ static inline int64_t get_clock_realtime(void)
    also used by simpletrace backend and tracepoints would cause
    an infinite recursion! */
 #ifdef _WIN32
-extern int64_t clock_freq;
 
-static inline int64_t get_clock(void)
-{
-    LARGE_INTEGER ti;
-    QueryPerformanceCounter(&ti);
-    return muldiv64(ti.QuadPart, get_ticks_per_sec(), clock_freq);
-}
+int64_t get_clock(void);
 
 #else
 
diff --git a/util/qemu-timer-common.c b/util/qemu-timer-common.c
index 95e0847..22b0109 100644
--- a/util/qemu-timer-common.c
+++ b/util/qemu-timer-common.c
@@ -28,7 +28,16 @@
 
 #ifdef _WIN32
 
-int64_t clock_freq;
+#include "qemu/winapi.h" /* QueryPerformanceCounter, ... */
+
+static int64_t clock_freq;
+
+int64_t get_clock(void)
+{
+    LARGE_INTEGER ti;
+    QueryPerformanceCounter(&ti);
+    return muldiv64(ti.QuadPart, get_ticks_per_sec(), clock_freq);
+}
 
 static void __attribute__((constructor)) init_get_clock(void)
 {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h
  2014-03-20  6:25 [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
                   ` (2 preceding siblings ...)
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 3/5] w32: Move inline function from header file to C source Stefan Weil
@ 2014-03-20  6:25 ` Stefan Weil
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files Stefan Weil
  2014-03-20  6:29 ` [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
  5 siblings, 0 replies; 11+ messages in thread
From: Stefan Weil @ 2014-03-20  6:25 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Stefan Weil, qemu-devel, Anthony Liguori, Max Filippov

Most *.o files depend on that file, but many of them don't need windows.h
or winsock2.h. sysemu/os-win32.h only needs some definitions from
winerror.h.

After that change, all files which depend on windows.h or winsock2.h and
which no longer get it indirectly have to be fixed. Use qemu/sockets.h
to get winsock2.h. Add comments to all those new include statements.

The modification in ui/vnc-enc-tight.c is needed temporarily and will be
removed again in the following patch.

Cc: Anthony Liguori <aliguori@amazon.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 coroutine-win32.c           |    1 +
 include/net/eth.h           |    2 +-
 include/sysemu/os-win32.h   |    3 +--
 target-xtensa/xtensa-semi.c |    1 +
 ui/vnc-enc-tight.c          |    1 +
 5 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/coroutine-win32.c b/coroutine-win32.c
index edc1f72..4678d17 100644
--- a/coroutine-win32.c
+++ b/coroutine-win32.c
@@ -24,6 +24,7 @@
 
 #include "qemu-common.h"
 #include "block/coroutine_int.h"
+#include "qemu/winapi.h"   /* CreateFiber, ... */
 
 typedef struct
 {
diff --git a/include/net/eth.h b/include/net/eth.h
index b3273b8..f5a369f 100644
--- a/include/net/eth.h
+++ b/include/net/eth.h
@@ -26,10 +26,10 @@
 #ifndef QEMU_ETH_H
 #define QEMU_ETH_H
 
-#include <sys/types.h>
 #include <string.h>
 #include "qemu/bswap.h"
 #include "qemu/iov.h"
+#include "qemu/sockets.h" /* u_short */
 
 #define ETH_ALEN 6
 
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index 1d6494a..d625612 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -26,8 +26,7 @@
 #ifndef QEMU_OS_WIN32_H
 #define QEMU_OS_WIN32_H
 
-#include "qemu/winapi.h"
-#include <winsock2.h>
+#include <winerror.h> /* WSAECONNREFUSED, ... */
 
 /* Workaround for older versions of MinGW. */
 #ifndef ECONNREFUSED
diff --git a/target-xtensa/xtensa-semi.c b/target-xtensa/xtensa-semi.c
index 424253d..ad06f99 100644
--- a/target-xtensa/xtensa-semi.c
+++ b/target-xtensa/xtensa-semi.c
@@ -32,6 +32,7 @@
 #include "cpu.h"
 #include "helper.h"
 #include "qemu/log.h"
+#include "qemu/sockets.h" /* select */
 
 enum {
     TARGET_SYS_exit = 1,
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index 59b59c0..9b0f73d 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -31,6 +31,7 @@
 /* This needs to be before jpeglib.h line because of conflict with
    INT32 definitions between jmorecfg.h (included by jpeglib.h) and
    Win32 basetsd.h (included by windows.h). */
+#include "qemu/winapi.h" /* TODO: workaround, remove */
 #include "qemu-common.h"
 
 #ifdef CONFIG_VNC_PNG
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files
  2014-03-20  6:25 [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
                   ` (3 preceding siblings ...)
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h Stefan Weil
@ 2014-03-20  6:25 ` Stefan Weil
  2014-03-20 14:00   ` Andreas Färber
  2014-03-20  6:29 ` [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
  5 siblings, 1 reply; 11+ messages in thread
From: Stefan Weil @ 2014-03-20  6:25 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Stefan Weil, Stefan Hajnoczi, qemu-devel, Anthony Liguori,
	Andreas Färber

These header files are used by most QEMU source files. If they
depend on windows.h, all those source files do so, too.

All Windows specific data types which are replaced use identical
definitions for the 32 and 64 bit Windows APIs. HANDLE, LONG
and CRITICAL_SECTION are replaced by the compatible types
WinHandle, WinLong and WinCriticalSection.

Add an explicit dependency on qemu/winapi.h for some files which need it.
These sources use the Windows API (see comment after include statement)
and no longer get windows.h indirectly from other header files.

A workaround which was added in the previous patch is no longer needed.

Now 175 *.o files remain which still depend on windows.h.

Cc: Anthony Liguori <aliguori@amazon.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 cpus.c                        |    4 +++-
 hw/intc/apic.c                |    3 ++-
 include/qemu/event_notifier.h |    8 ++------
 include/qemu/main-loop.h      |    4 ++--
 include/qemu/thread-win32.h   |   29 ++++++++++++++++++++---------
 include/qom/cpu.h             |    2 +-
 include/sysemu/os-win32.h     |    7 +++++++
 ui/vnc-enc-tight.c            |    5 -----
 util/event_notifier-win32.c   |    1 +
 util/qemu-thread-win32.c      |   17 +++++++++--------
 10 files changed, 47 insertions(+), 33 deletions(-)

diff --git a/cpus.c b/cpus.c
index 1104d61..ab5d15a 100644
--- a/cpus.c
+++ b/cpus.c
@@ -39,7 +39,9 @@
 #include "qemu/bitmap.h"
 #include "qemu/seqlock.h"
 
-#ifndef _WIN32
+#ifdef _WIN32
+#include "qemu/winapi.h" /* SuspendThread, ... */
+#else
 #include "qemu/compatfd.h"
 #endif
 
diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index 361ae90..6bb2d78 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -16,12 +16,13 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, see <http://www.gnu.org/licenses/>
  */
-#include "qemu/thread.h"
+
 #include "hw/i386/apic_internal.h"
 #include "hw/i386/apic.h"
 #include "hw/i386/ioapic.h"
 #include "hw/pci/msi.h"
 #include "qemu/host-utils.h"
+#include "qemu/thread.h"
 #include "trace.h"
 #include "hw/i386/pc.h"
 #include "hw/i386/apic-msidef.h"
diff --git a/include/qemu/event_notifier.h b/include/qemu/event_notifier.h
index bdca689..c5cf381 100644
--- a/include/qemu/event_notifier.h
+++ b/include/qemu/event_notifier.h
@@ -15,13 +15,9 @@
 
 #include "qemu-common.h"
 
-#ifdef _WIN32
-#include "qemu/winapi.h"
-#endif
-
 struct EventNotifier {
 #ifdef _WIN32
-    HANDLE event;
+    WinHandle event;
 #else
     int rfd;
     int wfd;
@@ -40,7 +36,7 @@ int event_notifier_set_handler(EventNotifier *, EventNotifierHandler *);
 void event_notifier_init_fd(EventNotifier *, int fd);
 int event_notifier_get_fd(EventNotifier *);
 #else
-HANDLE event_notifier_get_handle(EventNotifier *);
+WinHandle event_notifier_get_handle(EventNotifier *);
 #endif
 
 #endif
diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h
index 6f0200a..aefdc94 100644
--- a/include/qemu/main-loop.h
+++ b/include/qemu/main-loop.h
@@ -152,7 +152,7 @@ typedef void WaitObjectFunc(void *opaque);
  * @func: A function to be called when @handle is in a signaled state.
  * @opaque: A pointer-size value that is passed to @func.
  */
-int qemu_add_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
+int qemu_add_wait_object(WinHandle handle, WaitObjectFunc *func, void *opaque);
 
 /**
  * qemu_del_wait_object: Unregister a callback for a Windows handle
@@ -163,7 +163,7 @@ int qemu_add_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
  * @func: The function that was passed to qemu_add_wait_object.
  * @opaque: A pointer-size value that was passed to qemu_add_wait_object.
  */
-void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
+void qemu_del_wait_object(WinHandle handle, WaitObjectFunc *func, void *opaque);
 #endif
 
 /* async I/O support */
diff --git a/include/qemu/thread-win32.h b/include/qemu/thread-win32.h
index 7ade61a..b8b8e61 100644
--- a/include/qemu/thread-win32.h
+++ b/include/qemu/thread-win32.h
@@ -1,24 +1,35 @@
 #ifndef __QEMU_THREAD_WIN32_H
 #define __QEMU_THREAD_WIN32_H 1
-#include "qemu/winapi.h"
+
+/* WinCriticalSection is a substitute for CRITICAL_SECTION and
+ * introduced here to avoid dependencies on windows.h. */
+
+typedef struct {
+    WinHandle DebugInfo;
+    WinLong LockCount;
+    WinLong RecursionCount;
+    WinHandle OwningThread;
+    WinHandle LockSemaphore;
+    WinULong *SpinCount;
+} WinCriticalSection;
 
 struct QemuMutex {
-    CRITICAL_SECTION lock;
-    LONG owner;
+    WinCriticalSection lock;
+    WinLong owner;
 };
 
 struct QemuCond {
-    LONG waiters, target;
-    HANDLE sema;
-    HANDLE continue_event;
+    WinLong waiters, target;
+    WinHandle sema;
+    WinHandle continue_event;
 };
 
 struct QemuSemaphore {
-    HANDLE sema;
+    WinHandle sema;
 };
 
 struct QemuEvent {
-    HANDLE event;
+    WinHandle event;
 };
 
 typedef struct QemuThreadData QemuThreadData;
@@ -28,6 +39,6 @@ struct QemuThread {
 };
 
 /* Only valid for joinable threads.  */
-HANDLE qemu_thread_get_handle(QemuThread *thread);
+WinHandle qemu_thread_get_handle(QemuThread *thread);
 
 #endif
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index f99885a..1fe2ae4 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -215,7 +215,7 @@ struct CPUState {
 
     struct QemuThread *thread;
 #ifdef _WIN32
-    HANDLE hThread;
+    WinHandle hThread;
 #endif
     int thread_id;
     uint32_t host_tid;
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index d625612..a23d6aa 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -54,6 +54,13 @@
 # define EWOULDBLOCK  WSAEWOULDBLOCK
 #endif
 
+/* Define substitutes for the Win API types HANDLE, LONG, ULONG.
+ * These types are used to avoid dependencies on windows.h. */
+
+typedef void * WinHandle;
+typedef long WinLong;
+typedef unsigned long WinULong;
+
 #if defined(_WIN64)
 /* On w64, setjmp is implemented by _setjmp which needs a second parameter.
  * If this parameter is NULL, longjump does no stack unwinding.
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index 9b0f73d..3c5ff5a 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -27,11 +27,6 @@
  */
 
 #include "config-host.h"
-
-/* This needs to be before jpeglib.h line because of conflict with
-   INT32 definitions between jmorecfg.h (included by jpeglib.h) and
-   Win32 basetsd.h (included by windows.h). */
-#include "qemu/winapi.h" /* TODO: workaround, remove */
 #include "qemu-common.h"
 
 #ifdef CONFIG_VNC_PNG
diff --git a/util/event_notifier-win32.c b/util/event_notifier-win32.c
index 6dbb530..9f3f61d 100644
--- a/util/event_notifier-win32.c
+++ b/util/event_notifier-win32.c
@@ -13,6 +13,7 @@
 #include "qemu-common.h"
 #include "qemu/event_notifier.h"
 #include "qemu/main-loop.h"
+#include "qemu/winapi.h" /* CreateEvent, ... */
 
 int event_notifier_init(EventNotifier *e, int active)
 {
diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c
index b9c957b..6c8c6f8 100644
--- a/util/qemu-thread-win32.c
+++ b/util/qemu-thread-win32.c
@@ -10,11 +10,10 @@
  * See the COPYING file in the top-level directory.
  *
  */
+
+#include "qemu/winapi.h" /* LocalFree, ... */
 #include "qemu-common.h"
 #include "qemu/thread.h"
-#include <process.h>
-#include <assert.h>
-#include <limits.h>
 
 static bool name_threads;
 
@@ -38,18 +37,20 @@ static void error_exit(int err, const char *msg)
 void qemu_mutex_init(QemuMutex *mutex)
 {
     mutex->owner = 0;
-    InitializeCriticalSection(&mutex->lock);
+    /* mutex->lock uses a data type which must fit CRITICAL_SECTION. */
+    g_assert(sizeof(mutex->lock) == sizeof(CRITICAL_SECTION));
+    InitializeCriticalSection((CRITICAL_SECTION *)&mutex->lock);
 }
 
 void qemu_mutex_destroy(QemuMutex *mutex)
 {
     assert(mutex->owner == 0);
-    DeleteCriticalSection(&mutex->lock);
+    DeleteCriticalSection((CRITICAL_SECTION *)&mutex->lock);
 }
 
 void qemu_mutex_lock(QemuMutex *mutex)
 {
-    EnterCriticalSection(&mutex->lock);
+    EnterCriticalSection((CRITICAL_SECTION *)&mutex->lock);
 
     /* Win32 CRITICAL_SECTIONs are recursive.  Assert that we're not
      * using them as such.
@@ -62,7 +63,7 @@ int qemu_mutex_trylock(QemuMutex *mutex)
 {
     int owned;
 
-    owned = TryEnterCriticalSection(&mutex->lock);
+    owned = TryEnterCriticalSection((CRITICAL_SECTION *)&mutex->lock);
     if (owned) {
         assert(mutex->owner == 0);
         mutex->owner = GetCurrentThreadId();
@@ -74,7 +75,7 @@ void qemu_mutex_unlock(QemuMutex *mutex)
 {
     assert(mutex->owner == GetCurrentThreadId());
     mutex->owner = 0;
-    LeaveCriticalSection(&mutex->lock);
+    LeaveCriticalSection((CRITICAL_SECTION *)&mutex->lock);
 }
 
 void qemu_cond_init(QemuCond *cond)
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches
  2014-03-20  6:25 [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
                   ` (4 preceding siblings ...)
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files Stefan Weil
@ 2014-03-20  6:29 ` Stefan Weil
  2014-03-20 12:45   ` Peter Maydell
  5 siblings, 1 reply; 11+ messages in thread
From: Stefan Weil @ 2014-03-20  6:29 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

Am 20.03.2014 07:25, schrieb Stefan Weil:
> This includes a patch for GTK (needed for MinGW, but not restricted to it)
> and most of the patches which restructure the includes for the Win API.
> I ommitted the last optional block patch.
> 
> Stefan
> 
> [PULL for 2.0 1/5] gtk: Support GTK without VTE
> [PULL for 2.0 2/5] w32: Add and use intermediate include file for
> [PULL for 2.0 3/5] w32: Move inline function from header file to C
> [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h
> [PULL for 2.0 5/5] w32: Replace Windows specific data types in
> 

The most important part was missing, sorry:

The following changes since commit 06c1bee85a7def8d0139ee6829728a891efe623f:

  Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-2.0' into
staging (2014-03-19 23:34:43 +0000)

are available in the git repository at:


  git://qemu.weilnetz.de/qemu.git qemu-2.0

for you to fetch changes up to 66fd5183a49af4da5e873ec7a5e308f4226e9987:

  w32: Replace Windows specific data types in common header files
(2014-03-20 06:48:03 +0100)

----------------------------------------------------------------
Stefan Weil (5):
      gtk: Support GTK without VTE
      w32: Add and use intermediate include file for windows.h
      w32: Move inline function from header file to C source
      w32: Reduce dependencies in sysemu/os-win32.h
      w32: Replace Windows specific data types in common header files

 audio/audio_win_int.c         |    2 +-
 audio/dsoundaudio.c           |    2 +-
 audio/winwaveaudio.c          |    2 +-
 block.c                       |    2 +-
 block/raw-win32.c             |    2 +-
 block/win32-aio.c             |    2 +-
 configure                     |   56
++++++++++++++++++++++++++++-------------
 coroutine-win32.c             |    1 +
 cpus.c                        |    4 ++-
 hw/intc/apic.c                |    3 ++-
 include/net/eth.h             |    2 +-
 include/qemu/event_notifier.h |    8 ++----
 include/qemu/main-loop.h      |    4 +--
 include/qemu/sockets.h        |    2 +-
 include/qemu/thread-win32.h   |   29 ++++++++++++++-------
 include/qemu/timer.h          |    8 +-----
 include/qemu/winapi.h         |   22 ++++++++++++++++
 include/qom/cpu.h             |    2 +-
 include/sysemu/os-win32.h     |   10 ++++++--
 net/tap-win32.c               |    2 +-
 os-win32.c                    |    2 +-
 qga/channel-win32.c           |    2 +-
 qga/commands-win32.c          |    2 +-
 qga/service-win32.c           |    2 +-
 qga/service-win32.h           |    2 +-
 qga/vss-win32.c               |    2 +-
 qga/vss-win32/vss-common.h    |    2 +-
 slirp/slirp.h                 |    2 +-
 target-xtensa/xtensa-semi.c   |    1 +
 translate-all.c               |    2 +-
 ui/gtk.c                      |   17 ++++++++++++-
 ui/sdl.c                      |    3 ---
 ui/vnc-enc-tight.c            |    4 ---
 util/event_notifier-win32.c   |    1 +
 util/oslib-win32.c            |    2 +-
 util/qemu-thread-win32.c      |   17 +++++++------
 util/qemu-timer-common.c      |   11 +++++++-
 37 files changed, 156 insertions(+), 83 deletions(-)
 create mode 100644 include/qemu/winapi.h

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches
  2014-03-20  6:29 ` [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
@ 2014-03-20 12:45   ` Peter Maydell
  2014-03-20 19:12     ` Stefan Weil
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2014-03-20 12:45 UTC (permalink / raw)
  To: Stefan Weil; +Cc: QEMU Developers

On 20 March 2014 06:29, Stefan Weil <sw@weilnetz.de> wrote:
> Am 20.03.2014 07:25, schrieb Stefan Weil:
>> This includes a patch for GTK (needed for MinGW, but not restricted to it)
>> and most of the patches which restructure the includes for the Win API.
>> I ommitted the last optional block patch.
>>
>> Stefan
>>
>> [PULL for 2.0 1/5] gtk: Support GTK without VTE
>> [PULL for 2.0 2/5] w32: Add and use intermediate include file for
>> [PULL for 2.0 3/5] w32: Move inline function from header file to C
>> [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h
>> [PULL for 2.0 5/5] w32: Replace Windows specific data types in
>>
>
> The most important part was missing, sorry:
>
> The following changes since commit 06c1bee85a7def8d0139ee6829728a891efe623f:
>
>   Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-2.0' into
> staging (2014-03-19 23:34:43 +0000)
>
> are available in the git repository at:
>
>
>   git://qemu.weilnetz.de/qemu.git qemu-2.0

I'm afraid this doesn't build on my mingw32 setup:

  CC    util/rfifolock.o
In file included from
/home/petmay01/linaro/qemu-for-merges/include/qemu/thread.h:14,
                 from
/home/petmay01/linaro/qemu-for-merges/include/qemu/rfifolock.h:17,
                 from /home/petmay01/linaro/qemu-for-merges/util/rfifolock.c:15:
/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:8:
error: expected specifier-qualifier-list before ‘WinHandle’
/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:18:
error: expected specifier-qualifier-list before ‘WinLong’
/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:22:
error: expected specifier-qualifier-list before ‘WinLong’
/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:28:
error: expected specifier-qualifier-list before ‘WinHandle’
/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:32:
error: expected specifier-qualifier-list before ‘WinHandle’
/home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:42:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘qemu_thread_get_handle’
make: *** [util/rfifolock.o] Error 1

thanks
-- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files
  2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files Stefan Weil
@ 2014-03-20 14:00   ` Andreas Färber
  0 siblings, 0 replies; 11+ messages in thread
From: Andreas Färber @ 2014-03-20 14:00 UTC (permalink / raw)
  To: Stefan Weil, Peter Maydell; +Cc: Stefan Hajnoczi, qemu-devel, Anthony Liguori

Am 20.03.2014 07:25, schrieb Stefan Weil:
> These header files are used by most QEMU source files. If they
> depend on windows.h, all those source files do so, too.
> 
> All Windows specific data types which are replaced use identical
> definitions for the 32 and 64 bit Windows APIs. HANDLE, LONG
> and CRITICAL_SECTION are replaced by the compatible types
> WinHandle, WinLong and WinCriticalSection.
> 
> Add an explicit dependency on qemu/winapi.h for some files which need it.
> These sources use the Windows API (see comment after include statement)
> and no longer get windows.h indirectly from other header files.
> 
> A workaround which was added in the previous patch is no longer needed.
> 
> Now 175 *.o files remain which still depend on windows.h.
> 
> Cc: Anthony Liguori <aliguori@amazon.com>
> Cc: Stefan Hajnoczi <stefanha@redhat.com>
> Cc: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

For the record, I'm okay with WinHandle. I thought someone had
objections against some struct, but seems I missed either a discussion
or a respin.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches
  2014-03-20 12:45   ` Peter Maydell
@ 2014-03-20 19:12     ` Stefan Weil
  2014-03-20 19:16       ` Peter Maydell
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Weil @ 2014-03-20 19:12 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

Am 20.03.2014 13:45, schrieb Peter Maydell:
> On 20 March 2014 06:29, Stefan Weil <sw@weilnetz.de> wrote:
>> Am 20.03.2014 07:25, schrieb Stefan Weil:
>>> This includes a patch for GTK (needed for MinGW, but not restricted to it)
>>> and most of the patches which restructure the includes for the Win API.
>>> I ommitted the last optional block patch.
>>>
>>> Stefan
>>>
>>> [PULL for 2.0 1/5] gtk: Support GTK without VTE
>>> [PULL for 2.0 2/5] w32: Add and use intermediate include file for
>>> [PULL for 2.0 3/5] w32: Move inline function from header file to C
>>> [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h
>>> [PULL for 2.0 5/5] w32: Replace Windows specific data types in
>>>
>>
>> The most important part was missing, sorry:
>>
>> The following changes since commit 06c1bee85a7def8d0139ee6829728a891efe623f:
>>
>>   Merge remote-tracking branch 'remotes/afaerber/tags/prep-for-2.0' into
>> staging (2014-03-19 23:34:43 +0000)
>>
>> are available in the git repository at:
>>
>>
>>   git://qemu.weilnetz.de/qemu.git qemu-2.0
> 
> I'm afraid this doesn't build on my mingw32 setup:
> 
>   CC    util/rfifolock.o
> In file included from
> /home/petmay01/linaro/qemu-for-merges/include/qemu/thread.h:14,
>                  from
> /home/petmay01/linaro/qemu-for-merges/include/qemu/rfifolock.h:17,
>                  from /home/petmay01/linaro/qemu-for-merges/util/rfifolock.c:15:
> /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:8:
> error: expected specifier-qualifier-list before ‘WinHandle’
> /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:18:
> error: expected specifier-qualifier-list before ‘WinLong’
> /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:22:
> error: expected specifier-qualifier-list before ‘WinLong’
> /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:28:
> error: expected specifier-qualifier-list before ‘WinHandle’
> /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:32:
> error: expected specifier-qualifier-list before ‘WinHandle’
> /home/petmay01/linaro/qemu-for-merges/include/qemu/thread-win32.h:42:
> error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
> ‘qemu_thread_get_handle’
> make: *** [util/rfifolock.o] Error 1
> 
> thanks
> -- PMM
> 

Unfortunately a recent commit added new code in util/, and that code
needs a modification of patch 5/5. I really should have re-run the
compile test :-(

Peter, is it possible to pull only patches 1-4? They compile and are
fine, and we'd save mail bandwidth if I don't have to send them again.
You could also apply only patch 1. It is the only really important one
because it adds GTK for Windows users. The other ones can also be
applied after QEMU 2.0, if you prefer that.

I'll send an updated patch 5, and because it is modified, it will need a
new review.

Cheers,
Stefan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches
  2014-03-20 19:12     ` Stefan Weil
@ 2014-03-20 19:16       ` Peter Maydell
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2014-03-20 19:16 UTC (permalink / raw)
  To: Stefan Weil; +Cc: QEMU Developers

On 20 March 2014 19:12, Stefan Weil <sw@weilnetz.de> wrote:
> Unfortunately a recent commit added new code in util/, and that code
> needs a modification of patch 5/5. I really should have re-run the
> compile test :-(
>
> Peter, is it possible to pull only patches 1-4? They compile and are
> fine, and we'd save mail bandwidth if I don't have to send them again.
> You could also apply only patch 1. It is the only really important one
> because it adds GTK for Windows users. The other ones can also be
> applied after QEMU 2.0, if you prefer that.

I'm afraid I can only either apply or not apply pullrequests.
You can always resend just the cover letter if the only
thing you're doing is dropping some patches from it.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-03-20 19:17 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-20  6:25 [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 1/5] gtk: Support GTK without VTE Stefan Weil
2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 2/5] w32: Add and use intermediate include file for windows.h Stefan Weil
2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 3/5] w32: Move inline function from header file to C source Stefan Weil
2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 4/5] w32: Reduce dependencies in sysemu/os-win32.h Stefan Weil
2014-03-20  6:25 ` [Qemu-devel] [PULL for 2.0 5/5] w32: Replace Windows specific data types in common header files Stefan Weil
2014-03-20 14:00   ` Andreas Färber
2014-03-20  6:29 ` [Qemu-devel] [PULL for 2.0 0/5] MinGW related patches Stefan Weil
2014-03-20 12:45   ` Peter Maydell
2014-03-20 19:12     ` Stefan Weil
2014-03-20 19:16       ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.