Fixed headers to build for windows-64 but without virtfs. 11/273411/1
authorvarinder.p <varinder.p@samsung.com>
Sat, 2 Apr 2022 13:09:36 +0000 (18:39 +0530)
committerVarinder Pratap Singh <varinder.p@samsung.com>
Tue, 5 Apr 2022 08:30:06 +0000 (14:00 +0530)
Change-Id: Ibd750818ff0eeb0f306e3d5bc224b789b75d8523
Signed-off-by: varinder.p <varinder.p@samsung.com>
40 files changed:
Makefile
configure
hw/9pfs/9p.c
hw/9pfs/9p.h
hw/vigs/vigs_qt5.cpp
include/qemu/xattr.h
linux-user/x86_64/vsyscall.h [new file with mode: 0644]
package/build.linux
pc-bios/optionrom/Makefile
rules.mak
test_tizen_emulator.sh
tizen/emulator_configure.sh
tizen/src/ecs/ecs.c
tizen/src/ecs/ecs.h
tizen/src/ecs/ecs_eventcast.c
tizen/src/ecs/ecs_hds.c
tizen/src/ecs/ecs_nfc.c
tizen/src/ecs/ecs_sensor.c
tizen/src/emulator.c
tizen/src/eventcast/common.c
tizen/src/hw/pci/maru_tuner.c
tizen/src/ui/Makefile.objs
tizen/src/ui/displayglwidget.cpp
tizen/src/ui/displayswwidget.cpp
tizen/src/ui/displayswwidget.h
tizen/src/ui/mainwindow.cpp
tizen/src/ui/mainwindow.h
tizen/src/ui/menu/contextmenu.cpp
tizen/src/ui/menu/contextmenu.h
tizen/src/ui/menu/sdbhelper.cpp
tizen/src/ui/menu/sdbhelperthread.cpp
tizen/src/ui/qt5_supplement.cpp
tizen/src/util/net_helper.c
tizen/src/util/net_helper.h
tizen/src/util/new_debug_ch.c
tizen/src/util/osutil-linux.c
tizen/src/util/osutil-win32.c
tizen/src/util/osutil.h
tizen/standalone-src/Makefile
tizen/standalone-src/qt5_msgbox.rc

index 8a9113e6663eb51cf842b2f4f5a259280b179677..4b03ed08c06ada86544669cf2139fbd310a22401 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -329,7 +329,7 @@ Makefile: ;
 configure: ;
 
 .PHONY: all clean cscope distclean html info install install-doc \
-       pdf txt recurse-all dist msi FORCE
+       pdf txt recurse-all dist msi install-tools FORCE
 
 $(call set-vpath, $(SRC_PATH))
 
@@ -927,7 +927,11 @@ ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512
 install-includedir:
        $(INSTALL_DIR) "$(DESTDIR)$(includedir)"
 
-install: all $(if $(BUILD_DOCS),install-doc) \
+install-tools: tools
+       $(call install-prog,$(filter-out qemu-ga,$(TOOLS)),$(DESTDIR)$(bindir))
+       # qemu-ga is included in TOOLS, but we need special install rules for w32
+
+install: all $(if $(BUILD_DOCS),install-doc) $(if $(BUILD_TOOLS),install-tools) \
        install-datadir install-localstatedir install-includedir \
        $(if $(INSTALL_BLOBS),$(edk2-decompressed)) \
        recurse-install
index d9730ab9f4910a2dc82e209799b9224314bd9f67..62818fc2aa207a087bf377079a69befc83647f9d 100755 (executable)
--- a/configure
+++ b/configure
@@ -462,7 +462,7 @@ guest_agent_ntddscsi="no"
 guest_agent_msi=""
 vss_win32_sdk=""
 win_sdk="no"
-want_tools="yes"
+want_tools=""
 libiscsi=""
 libnfs=""
 coroutine=""
@@ -490,7 +490,7 @@ qemu_private_xts="yes"
 auth_pam=""
 vte=""
 virglrenderer=""
-tpm="yes"
+tpm=""
 libssh=""
 live_block_migration="yes"
 numa=""
@@ -528,7 +528,7 @@ libtizenusb="no"
 
 # for TIZEN-maru
 maru="no"
-winver="0x600"
+winver="0x0600"
 libav=""
 libpng="no"
 dxva2=""
@@ -830,6 +830,7 @@ MINGW32*)
   else
     audio_drv_list=""
   fi
+  QEMU_INCLUDES="-I\$(SRC_PATH)/hosts/w32/include $QEMU_INCLUDES"
   supported_os="yes"
   pie="no"
 ;;
@@ -1973,7 +1974,7 @@ TIZEN-maru options:
   --enable-libpng          enable png library
   --enable-dxva2           enable dxva2 support
   --disable-dxva2          disable dxva2 support
-  --ensable-vaapi          enable vaapi support
+  --enable-vaapi           enable vaapi support
   --disable-vaapi          disable vaapi support
   --extension-path=PATH    set extension path
 
@@ -6692,16 +6693,10 @@ if test "$want_tools" = "yes" ; then
   fi
 fi
 if test "$softmmu" = yes ; then
-  if test "$virtfs" != no; then
-    if test "$cap_ng" = yes && test "$linux" = yes && test "$attr" = yes ; then
+  if test "$linux" = yes; then
+    if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
       virtfs=yes
       tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
-    elif test "$maru" = yes && test "$darwin" = yes ; then
-      echo "Enable VirtFS on Darwin"
-      virtfs=yes
-    elif test "$maru" = yes && test "$mingw32" = yes ; then
-      echo "Enable VirtFS on Windows"
-      virtfs=yes
     else
       if test "$virtfs" = yes; then
         error_exit "VirtFS requires libcap-ng devel and libattr devel"
@@ -6717,6 +6712,13 @@ if test "$softmmu" = yes ; then
       mpath=no
     fi
     tools="$tools scsi/qemu-pr-helper\$(EXESUF)"
+  elif test "$maru" = yes && test "$darwin" = yes ; then
+      echo "Enable VirtFS on Darwin"
+      virtfs=yes
+  elif test "$maru" = yes && test "$mingw32" = yes ; then
+      echo "Enable VirtFS on Windows"
+      #virtfs=yes TODO : can;t do this shit now
+      virtfs=no
   else
     if test "$virtfs" = yes; then
       error_exit "VirtFS is supported only on Linux"
index 1b729af6e8cec4a44fb45142a1d79ab9f55138e1..63529724ca9cad7103a4e4300baca690462ba101 100644 (file)
@@ -28,7 +28,6 @@
 #include "sysemu/qtest.h"
 #include "qemu/xxhash.h"
 #include <math.h>
-#include <linux/limits.h>
 
 int open_fd_hw;
 int total_open_fd;
index 656527beb9de857fbcc7507e3318fff7209fa668..b4d6c4f6b38a0da1832b5d3888a568f3a7dc7eef 100644 (file)
@@ -3,7 +3,11 @@
 
 #include <dirent.h>
 #include <utime.h>
+
+#if !defined(CONFIG_MARU) || !defined(CONFIG_WIN32)
 #include <sys/resource.h>
+#endif
+
 #include "fsdev/file-op-9p.h"
 #include "fsdev/9p-iov-marshal.h"
 #include "qemu/thread.h"
@@ -119,7 +123,25 @@ typedef enum P9ProtoVersion {
 #define FID_NON_RECLAIMABLE     0x2
 static inline char *rpath(FsContext *ctx, const char *path)
 {
+#if defined(CONFIG_MARU) && defined(CONFIG_WIN32)
+    char *buffer;
+    unsigned int len;
+
+    buffer = g_strdup_printf("%s\\%s", ctx->fs_root, path);
+    len = strlen(buffer);
+
+    // TODO : need to remove backslash??
+    while (len && buffer[len-1] == '\\') {
+        if (len > 1 && buffer[len-2] == ':') {
+            return buffer;
+        }
+        buffer[--len] = '\0';
+
+    }
+    return buffer;
+#else
     return g_strdup_printf("%s/%s", ctx->fs_root, path);
+#endif
 }
 
 /*
index 223210d8625850cc78835d5655e3e662403c9415..91b743ee929ee9ed4ddd4ccadf88da7967eaea39 100644 (file)
  *
  */
 
-#include <QGuiApplication>
-#include <QOpenGLContext>
-#include <qpa/qplatformnativeinterface.h>
-#include "vigs_qt5.h"
 
 extern "C" {
 #define QObject qemu_QObject
@@ -40,6 +36,11 @@ extern "C" {
 #undef QList
 }
 
+#include <QGuiApplication>
+#include <QOpenGLContext>
+#include <qpa/qplatformnativeinterface.h>
+#include "vigs_qt5.h"
+
 extern bool qt5IsOnscreen;
 extern QApplication *qt5App;
 extern QOpenGLContext *qt5GLContext;
index a83fe8e749bd72df7e7258d40cd58a05319ab608..99862735dc5fd2360429b3b7810b5bf02dbbb9ba 100644 (file)
 #ifdef CONFIG_LIBATTR
 #  include <attr/xattr.h>
 #else
+#ifndef ENOATTR
 #  define ENOATTR ENODATA
+#endif
+# ifdef CONFIG_MARU
+#  ifndef CONFIG_WIN32
 #  include <sys/xattr.h>
+#  endif
+# endif
 #endif
 
 #endif
diff --git a/linux-user/x86_64/vsyscall.h b/linux-user/x86_64/vsyscall.h
new file mode 100644 (file)
index 0000000..11dcc07
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef VSYSCALL_H
+#define VSYSCALL_H
+
+/* This is based on asm/syscall.h in kernel 2.6.29. */
+
+enum vsyscall_num {
+    __NR_vgettimeofday,
+    __NR_vtime,
+    __NR_vgetcpu,
+};
+
+#define TARGET_VSYSCALL_START (-10UL << 20)
+#define TARGET_VSYSCALL_SIZE 1024
+#define TARGET_VSYSCALL_END (-2UL << 20)
+#define TARGET_VSYSCALL_MAPPED_PAGES 1
+#define TARGET_VSYSCALL_ADDR(vsyscall_nr) \
+    (TARGET_VSYSCALL_START+TARGET_VSYSCALL_SIZE*(vsyscall_nr))
+
+#endif /* !VSYSCALL_H */
index e8231546bbd90fca0641137e49571d065cd3f4bf..066e059b292519e24487c9b5a2fdedb8431185b0 100755 (executable)
@@ -18,7 +18,7 @@ prepare()
                        export PATH=/opt/mingw32/bin:$PATH
                        export CROSS_PREFIX=i686-w64-mingw32
                else
-                       export PATH=/opt/mingw64/bin:$PATH
+                       export PATH=/usr/x86_64-w64-mingw32/bin:$PATH
                        export CROSS_PREFIX=x86_64-w64-mingw32
                fi
 
index cbc425d6f235ea19744ef524e52fae0317f53e6f..542bb6bf8731ba72b3b3af48109295668ba77c38 100644 (file)
@@ -13,7 +13,7 @@ $(call set-vpath, $(SRC_PATH)/pc-bios/optionrom)
 ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0)
 override CFLAGS += -O2
 endif
-override CFLAGS += -march=i486 #-fcf-protection=none
+override CFLAGS += -march=i486 -fcf-protection=none
 
 # Drop -fstack-protector and the like
 QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS)) $(CFLAGS_NOPIE) -ffreestanding
index 694865b63ee84f8b3e28f9b3bb233abb4015cd00..ea1a86b59b7a9b8e3cb113354f0b612002a4bc31 100644 (file)
--- a/rules.mak
+++ b/rules.mak
@@ -103,7 +103,11 @@ LINK = $(call quiet-command, $(LINKPROG) $(CFLAGS) $(QEMU_LDFLAGS) -o $@ \
 %.o: %.dtrace
        $(call quiet-command,dtrace -o $@ -G -s $<,"GEN","$(TARGET_DIR)$@")
 
+ifdef CONFIG_WIN32
+DSO_OBJ_CFLAGS := -DBUILD_DSO
+else
 DSO_OBJ_CFLAGS := -fPIC -DBUILD_DSO
+endif
 module-common.o: CFLAGS += $(DSO_OBJ_CFLAGS)
 %$(DSOSUF): QEMU_LDFLAGS += $(LDFLAGS_SHARED)
 %$(DSOSUF): %.mo
index 9f9c132af1acb48afa229fe40a43b0d50c2e8e95..8a6de7b83c83882457b882c393da4530eecb48d9 100755 (executable)
@@ -14,8 +14,7 @@ test()
     mkdir -p ./tizen_test_binaries/
 
     UNZIP_PATH=`which unzip`
-    if $UNZIP_PATH==""
-    then
+    if $UNZIP_PATH==""; then
         echo "Install unzip utility"
         echo "sudo apt install unzip"
         exit
index fd684630fe164e8b7d220ab9bce55234b9ed8475..d31e1cc6ae30cb1b5be09347da5b034544edfae1 100755 (executable)
@@ -154,7 +154,6 @@ CONFIGURE_APPEND_WIN="
  --extra-ldflags=-static-libstdc++
  --audio-drv-list=dsound
  --winver=0x0600
- --enable-sdl
  --enable-hax"
 
 # append platform specific options
index f675b6abcf5f42eef1fba052821a5858a78f3eb5..501dc34bef8aa13d289616846249b9d32ddb145d 100644 (file)
@@ -39,6 +39,7 @@
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qnum.h"
 #include "hw/qdev.h"
+#include "sysemu/runstate.h"
 #include "net/net.h"
 #include "ui/console.h"
 
 #include "hw/virtio/maru_virtio_sensor.h"
 #include "hw/virtio/maru_virtio_nfc.h"
 
+#ifndef _WIN32
+#include <sys/ioctl.h>
+#endif
+
 #include "debug_ch.h"
 MULTI_DEBUG_CHANNEL(qemu, ecs);
 
@@ -994,3 +999,8 @@ int start_ecs(void)
 
     return 0;
 }
+
+
+void ecs_qemu_system_reset_request(void) {
+    qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
+}
index 72dbc3f22298121c2d2060e4723f8fa03fda0717..7f862d211af42e879e1cda3b53d674861351dfe4 100644 (file)
@@ -32,8 +32,6 @@
 #ifndef __ECS_H__
 #define __ECS_H__
 
-#include "emulator_common.h"
-
 #define COMMANDS_TYPE           "type"
 #define COMMANDS_DATA           "data"
 
 
 #define NFC_MAX_BUF_SIZE  4096
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct nfc_msg_info {
     unsigned char client_id;
     unsigned char client_type;
@@ -78,6 +80,8 @@ enum ecs_system_action {
     ECS_SYSTEM_ACTION_REBOOT
 };
 
+void ecs_qemu_system_reset_request(void);
+
 void send_shutdown_request(int action);
 
 void make_send_device_ntf(char *cmd, int group, int action, char *data);
@@ -97,5 +101,7 @@ void ecs_suspend_lock_state(int state);
 /* Device capabilities check */
 const char* ecs_get_device_capabilities(void);
 void ecs_set_device_capabilities(const char* cap);
-
+#ifdef __cplusplus
+}
+#endif
 #endif /* __ECS_H__ */
index 3aee5250377e6a099727253f71b75ce3bed5645e..a118e4e778aa55101fa043e9afbe89245a805df5 100644 (file)
@@ -26,7 +26,7 @@
  * - S-Core Co., Ltd
  *
  */
-
+#include "emulator_common.h"
 #include "ecs.h"
 #include "ecs_internal.h"
 #include "ecs_sensor.h"
index 339ddd15cb0e3ca16d25ea6882fc927d05a0fd4e..da4bb1b2b6e141b986a7872b1716147cb6a4df3b 100644 (file)
@@ -29,7 +29,9 @@
 
 #include "emulator_common.h"
 #include "qemu/thread.h"
+#ifdef CONFIG_VIRTFS
 #include "fsdev/qemu-fsdev.h"
+#endif
 #include "emul_state.h"
 #include "ecs.h"
 #include "ecs_hds.h"
index c37936b92c9c617e1af2fe6cb267e45313a2407e..fe2bfd030861be3932b4f94af85b5e8d1039c277 100644 (file)
@@ -27,9 +27,7 @@
  *
  */
 
-#include "qemu/osdep.h"
-#include "qemu-common.h"
-
+#include "emulator_common.h"
 #include "ecs.h"
 #include "ecs_internal.h"
 
index 3ddcd75b7de5df75538dcaf37ccddf130a427e19..0d030b70e57781e74546bc2efaa4f4521d41de3b 100644 (file)
@@ -29,6 +29,7 @@
  *
  */
 
+#include "emulator_common.h"
 #include "ecs.h"
 #include "ecs_internal.h"
 #include "ecs_sensor.h"
index bfe3d6248046cfc75c6c335d5a794ca8bd562763..27b8d9f4f4ad9f9e079f60c713ff738110fca85d 100644 (file)
@@ -295,7 +295,7 @@ static int emulator_main(int argc, char *argv[], char **envp)
     }
 
     if (!launch_conf_file && qemu_arg_index == 0) {
-        char *executable = basename(argv[0]);
+        char *executable = g_path_get_basename(argv[0]);
         fprintf(stderr, "Usage: %s {-c|--conf} conf_file [--<key> <value>]...\n"
                         "       %*s [{-q|--qemu} <QEMU_ARGS>...]\n",
                         executable, (int)strlen(executable), "");
index 6672e65f058f4629ccb854e314694c258370ecbd..7e4179f69ef71fe7809a931084c7482d07ec2ce3 100644 (file)
@@ -45,9 +45,6 @@
 
 #ifndef __WIN32
 #include <sys/ioctl.h>
-#else
-#define EISCONN WSAEISCONN
-#define EALREADY WSAEALREADY
 #endif
 
 
@@ -104,10 +101,6 @@ static eventcast_recv_buf recv_buf;
 
 static void end_eventcast_socket(int sockfd);
 static void set_eventcast_connection_status(int status);
-#if 0
-static void set_eventcast_app_state(bool state);
-static bool get_eventcast_app_state(void);
-#endif
 
 static bool is_notifier = false;
 
index f9ec9e01b9e1a2c1084659f80fb3aea9979ae60e..5c48dd06109f30b91bfe7425abb881bbbcedcf98 100644 (file)
  *
  */
 
-#include "qemu/osdep.h"
+#include "emulator_common.h"
 #include "qemu/thread.h"
 #include "exec/memory.h"
 #include "exec/memory-internal.h"
 #include "tizen/src/emulator.h"
 #include "qemu/config-file.h"
 #include "qemu/main-loop.h"
-#include "qemu-common.h"
 #include "qapi/qmp/qdict.h"
 #include "hw/maru_device_ids.h"
 #include "hw/qdev-properties.h"
@@ -42,6 +41,7 @@
 #include "maru_tuner.h"
 #include "ecs/ecs.h"
 #include "util/new_debug_ch.h"
+#include <pthread.h>
 
 DECLARE_DEBUG_CHANNEL(tuner);
 
index 786e1cf98736cbb92ed79b5d7055336474c897c1..220a6bfddbee9768e98dc0e9bab5dd7681efbc80 100644 (file)
@@ -2,7 +2,7 @@ TIZEN_SRC = $(SRC_PATH)/tizen/src
 TIZEN_UI = $(SRC_PATH)/tizen/src/ui
 
 obj-$(CONFIG_QT) += qt5.o
-qt5.o-cflags += $(QEMU_CFLAGS) $(QT_CFLAGS) -I$(TIZEN_UI)
+qt5.o-cflags += $(QT_CFLAGS) -I$(TIZEN_UI)
 
 QEMU_CXXFLAGS += -I$(TIZEN_UI) -I$(TIZEN_SRC) $(QEMU_INCLUDES) $(QT_CFLAGS) -Wno-expansion-to-defined
 
index a9d33929ca598ce65158929f0ac7cc033d69a3b7..aeded3e09d39bb63ad79f0fc9a0aa748bcb3c507 100644 (file)
 extern "C" {
 #define QObject qemu_QObject
 #define QList qemu_QList
+#define bind qemu_bind
 //declare _Static_assert as there is none for cpp file in qemu 
 #define _Static_assert(x , msg) //Q_ASSERT_X(x , "tizen/ui/displayglwidget.o", msg) 
 #include "qemu/osdep.h"
 #include "qemu/thread.h"
 #undef QObject
 #undef QList
+#undef bind
 }
 
 #include <QtOpenGL>
index 3f16cd2185bcd8ff119ea8b3a4458654a1d74b6c..72b7e2fef5bd5c868b514d4844cd523d5cf58ea6 100644 (file)
 
 #include "displayswwidget.h"
 #include "input/multitouchtracker.h"
-
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "emulator_common.h"
 #include "emul_state.h"
-#undef QObject
-#undef QList
-};
 
 DisplaySWWidget::DisplaySWWidget(QWidget *parent,
     DisplayType *displayForm, QSize resolution, qreal scaleFactor) :
index 01dc7876dd188b378c18607b22332b7fbef14d1d..037205814ec044db01f71a47b5dbde573bdb88ca 100644 (file)
@@ -32,9 +32,8 @@
 #ifndef DISPLAYSWWIDGET_H
 #define DISPLAYSWWIDGET_H
 
-#include <QtWidgets>
-
 #include "displaybase.h"
+#include <QPainter>
 
 class DisplaySWWidget : public QLabel,
                         public DisplayBase
index 0dcad5206f9d2b0b1cfb961db8eb9ae78977607b..469a7ef77dc1f5f513c215ab61e4971f35aa6557 100644 (file)
@@ -31,6 +31,7 @@
  *
  */
 
+#include "uiutil.h"
 #include "mainwindow.h"
 #include "generalskinview.h"
 #include "phoneshapeskinview.h"
 #include "displayglwidget.h"
 #include "displayswwidget.h"
 #include "resource/ui_strings.h"
-#include "uiutil.h"
-
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "emulator.h"
 #include "util/ui_operations.h"
 #include "qt5_supplement.h"
-#undef QObject
-#undef QList
+
+extern "C" {
+extern void qemu_system_graceful_shutdown_request(unsigned int sec);
 }
 
 MainWindow::MainWindow(UiInformation *uiInfo, bool useGL, QWidget *parent) :
index 84159c7caecb568e56a6f6e113dc6734a516e53b..9d09ed3fc833901752a274bacf02e8bd2a13717c 100644 (file)
@@ -34,8 +34,6 @@
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
 
-#include <QWidget>
-
 #include "menu/contextmenu.h"
 #include "mainview.h"
 #include "displaybase.h"
index e4051c0bfeb6972f967fe8d8999d1cbfdccd0110..56f9a179368b3c62fdbab7d8d1b8530bbc473121 100644 (file)
  * - S-Core Co., Ltd
  *
  */
-
+#include "config-host.h"
 #include "contextmenu.h"
 #include "resource/ui_strings.h"
 #include "mainwindow.h"
 #include "uiutil.h"
 #include "menu/advancedmenuitem.h"
 #include "menu/scalemenuitem.h"
+#include "ecs/ecs.h"
 #include "emul_state.h"
-
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "util/osutil.h"
-#include "util/net_helper.h"
 #include "util/device_hotplug.h"
 #include "util/ui_operations.h"
-#include "sysemu/runstate.h"
-#include "ecs/ecs.h"
-#undef QObject
-#undef QList
-}
+#include "util/net_helper.h"
+#include "util/osutil.h"
 
 ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent)
 {
@@ -1184,7 +1176,7 @@ void ContextMenu::slotAbout()
 void ContextMenu::slotDeviceReset()
 {
     qDebug("System reset request.");
-    qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
+    ecs_qemu_system_reset_request();
     qDebug("Done for system reset request.");
 }
 
index 3fad2cac42f19f0afa83f83020ccc54d0e3c2509..1a1088c850359fb00bec3d01c4c8e843c2c82bcb 100644 (file)
@@ -32,8 +32,6 @@
 #ifndef CONTEXTMENU_H
 #define CONTEXTMENU_H
 
-#include <QtWidgets>
-
 #include "detailedinfodialog.h"
 #include "aboutdialog.h"
 #include "screenshotdialog.h"
index a8e386eb4468011a290e0b57db2591b14989809d..03a647385ac94190493afcf730f3268e0e19d677 100644 (file)
 #include "sdbhelper.h"
 #include "sdbhelperthread.h"
 #include "resource/ui_strings.h"
-
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "emulator_common.h"    
 #include "emul_state.h"
 #include "util/net_helper.h"
-#undef QObject
-#undef QList
-}
+#include "glib-compat.h"
 
 SdbHelper::SdbHelper(MainWindow *parent, DisplayBase *displaybase)
 {
index 1d68109224f2f303514cffda9e8396e9b424a99c..801b6c8643a23c07ab4a1bba5b636c4ab0cc52ee 100644 (file)
 #include "sdbhelper.h"
 #include "displaybase.h"
 #include "resource/ui_strings.h"
-
-extern "C" {
 #include "emul_state.h"
-}
 
 SdbHelperThread::SdbHelperThread(SdbHelper *parent)
 {
index 63b35de3b48f4a2906113cdade8b0f8213987e9c..4f89ddabd14deba5777327968c91b18fc00fd0be 100644 (file)
 #include "displaybase.h"
 #include "util/new_debug_ch.h"
 
-extern "C" {
-#define QObject qemu_QObject
-#define QList qemu_QList
-#include "emulator_common.h"
 #include "emul_state.h"
 #include "emulator_options.h"
-#undef QObject
-#undef QList
-}
+#include "glib-compat.h"
 
 // XXX: all modules in ui/* are controlled by channel name "qt5_ui"
 DECLARE_DEBUG_CHANNEL(qt5_ui);
@@ -205,9 +199,6 @@ static void qMessageOutput(QtMsgType type, const QMessageLogContext &context,
     QTextStream out(stdout);
     out.setFieldAlignment(QTextStream::AlignRight);
     out << qSetFieldWidth(12) << timestamp;
-    out << qSetFieldWidth(1) << "|";
-    out << qSetFieldWidth(5) << qemu_get_thread_id();
-    out << qSetFieldWidth(1) << "|";
     out << qSetFieldWidth(1) << typeChar;
     out << qSetFieldWidth(1) << "|";
     out << qSetFieldWidth(10) << path;
index b12e22d8533bf2882bea57a0e4e4e11833f4d541..9266e6a36b08d05b05b38e5f1bcfda95cb8ee40a 100644 (file)
 #include "new_debug_ch.h"
 #include "sysemu/runstate.h"
 
+#ifdef _WIN32
+//#include <ws2tcpip.h>
+#else /* !_WIN32 */
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <netdb.h>
+#endif /* !_WIN32 */
+
 DECLARE_DEBUG_CHANNEL(net_helper);
 
 #define BUF_SIZE 64
index 806fa551ce70663e805ff0b77f530275e8c5887b..8742da5378d539de86bacf5f5a9378d856c8432b 100644 (file)
 #ifndef SDB_SERVER_H_
 #define SDB_SERVER_H_
 
-#include <errno.h>
-#include <stdint.h>
-#include <stdbool.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#else /* !_WIN32 */
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#endif /* !_WIN32 */
-
-
 #define SDB_HOST_PORT 26099
 
 #define START_VM_BASE_PORT 26100
index 833f203573ce856326da59f04e07069005c1bb90..bce9c02cc81fc17a26554da51b83f96d60a2b876 100644 (file)
@@ -286,6 +286,23 @@ static void debug_init(void)
     }
 }
 
+static inline int get_timeofday(char *buf, size_t size)
+{
+    qemu_timeval tv;
+    time_t ti;
+    struct tm *ptm = NULL;
+    int ret;
+
+    qemu_gettimeofday(&tv);
+    ti = tv.tv_sec;
+
+    /* In this case, localtime_r() function is not necessary. */
+    ptm = localtime(&ti);
+    ret = strftime(buf, size, "%H:%M:%S", ptm);
+
+    return ret + g_snprintf(buf + ret, size - ret, ".%03ld", (long)tv.tv_usec/1000);
+}
+
 int dbg_log(enum _debug_class cls, struct _debug_channel *channel,
         int line, const char *format, ...)
 {
index c46e46123fc3c63744c3ae6c47fa793fbe41c1a6..200b3763f011ca294315a1422d1a0c4e569fd6a2 100644 (file)
@@ -32,6 +32,7 @@
   @brief    Collection of utilities for linux
  */
 
+#include <stdbool.h>
 #include <linux/version.h>
 #include <sys/utsname.h>
 #include <sys/sysinfo.h>
index 7a6fcfc3e8011576f643ecc0d4ed5933d1d06a42..e94899a72b792a6c1248b0256c5f3e10cf430fe7 100644 (file)
   @brief    Collection of utilities for win32
  */
 
-#include <windows.h>
-
-#include "png.h"
-
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include <glib/gprintf.h>
 #include "qemu/error-report.h"
+#include "png.h"
 #include "osutil.h"
 #include "emulator.h"
 #include "emul_state.h"
index cd3b28309d85d0d11aa833c5ec077465da134946..84347b9751d1e9aaf68cb7e3433723d5f06adddc 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef __OSUTIL_H__
 #define __OSUTIL_H__
 
-#include "emulator_common.h"
+#include "glib-compat.h"
 
 #define ERR_SUCCESS 0
 #define ERR_NODEV   4   /* ACT_SDCARD_DETACH_FAIL. No sdcard attached. */
@@ -71,23 +71,6 @@ typedef struct sdcard_info
 void print_system_info_os(void);
 int get_number_of_processors(void);
 
-static inline int get_timeofday(char *buf, size_t size)
-{
-    qemu_timeval tv;
-    time_t ti;
-    struct tm *ptm = NULL;
-    int ret;
-
-    qemu_gettimeofday(&tv);
-    ti = tv.tv_sec;
-
-    /* In this case, localtime_r() function is not necessary. */
-    ptm = localtime(&ti);
-    ret = strftime(buf, size, "%H:%M:%S", ptm);
-
-    return ret + g_snprintf(buf + ret, size - ret, ".%03ld", (long)tv.tv_usec/1000);
-}
-
 static inline void get_java_path(const char **java_path)
 {
 #ifdef CONFIG_WIN32
index 3413469db32a9fa7b2d3e2ba901d135f950685e6..2922b05ad52f04259fb28bdd7a25e62bf270b770 100644 (file)
@@ -6,12 +6,14 @@ TARGET_EXE += qt5_msgbox$(EXESUF)
 ifdef CONFIG_QT
 EMUL_DIR=../emulator
 
+BUILD_DIR=../..
+
 COMMON_FLAGS=$(QT_CFLAGS) $(QEMU_INCLUDES) $(libs_softmmu) -DQT_NO_OPENGL -lstdc++
 
 # for building qt5_msgbox
 $(TARGET_EXE): $(SRC_PATH)/tizen/standalone-src/qt5_msgbox.cpp
 ifdef CONFIG_WIN32
-       $(shell $(WINDRES) $(SRC_PATH)/tizen/standalone-src/qt5_msgbox.rc -O coff -o qt5_msgbox.res)
+       $(shell $(WINDRES) $(SRC_PATH)/tizen/standalone-src/qt5_msgbox.rc -I$(BUILD_DIR) -O coff -o qt5_msgbox.res)
        $(CXX) -o $(TARGET_EXE) qt5_msgbox.res $< $(COMMON_FLAGS)
 endif
 ifdef CONFIG_DARWIN
index 45f4761c7999d4b3ab400180b5813eed83b3a28c..394427f215b864295108b046ec613a7c470bcf39 100644 (file)
@@ -1,4 +1,4 @@
-#include "../../config-host.h"
+#include "config-host.h"
 
 #ifdef CONFIG_MARU
 ID_ICON ICON "../src/ui/resource/icons/emulator_icon.ico"