preserve partition table when using -linux option
[qemu] / sdl.c
diff --git a/sdl.c b/sdl.c
index f705eb7..f283d86 100644 (file)
--- a/sdl.c
+++ b/sdl.c
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <getopt.h>
-#include <inttypes.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <time.h>
-#include <sys/time.h>
-#include <malloc.h>
-#include <termios.h>
-#include <sys/poll.h>
-#include <errno.h>
-#include <sys/wait.h>
-#include <netinet/in.h>
+#include "vl.h"
 
 #include <SDL.h>
 
-#include "cpu.h"
-#include "exec-all.h"
-
-#include "vl.h"
+#ifndef _WIN32
+#include <signal.h>
+#endif
 
 static SDL_Surface *screen;
 static int gui_grab; /* if true, all keyboard/mouse events are grabbed */
@@ -145,11 +127,18 @@ static void sdl_process_key(SDL_KeyboardEvent *ev)
     
     /* XXX: not portable, but avoids complicated mappings */
     keycode = ev->keysym.scancode;
+#ifdef _WIN32
+    if (keycode < 97) {
+        /* nothing to do */
+    } else 
+#else
     if (keycode < 9) {
         keycode = 0;
     } else if (keycode < 97) {
         keycode -= 8; /* just an offset */
-    } else if (keycode < 158) {
+    } else 
+#endif
+    if (keycode < 158) {
         /* use conversion table */
         keycode = x_keycode_to_pc_keycode[keycode - 97];
     } else {
@@ -291,9 +280,12 @@ void sdl_display_init(DisplayState *ds)
         fprintf(stderr, "Could not initialize SDL - exiting\n");
         exit(1);
     }
+
+#ifndef _WIN32
     /* NOTE: we still want Ctrl-C to work, so we undo the SDL redirections */
     signal(SIGINT, SIG_DFL);
     signal(SIGQUIT, SIG_DFL);
+#endif
 
     ds->dpy_update = sdl_update;
     ds->dpy_resize = sdl_resize;