Index: ioemu/hw/vga.c
===================================================================
--- ioemu.orig/hw/vga.c	2007-05-02 16:04:46.000000000 +0100
+++ ioemu/hw/vga.c	2007-05-02 16:05:50.000000000 +0100
@@ -1622,7 +1622,9 @@
 static void vga_save(QEMUFile *f, void *opaque)
 {
     VGAState *s = opaque;
+#ifdef CONFIG_BOCHS_VBE
     int i;
+#endif
 
     qemu_put_be32s(f, &s->latch);
     qemu_put_8s(f, &s->sr_index);
@@ -1663,7 +1665,10 @@
 static int vga_load(QEMUFile *f, void *opaque, int version_id)
 {
     VGAState *s = opaque;
-    int is_vbe, i;
+    int is_vbe;
+#ifdef CONFIG_BOCHS_VBE
+    int i;
+#endif
 
     if (version_id != 1)
         return -EINVAL;
Index: ioemu/vl.c
===================================================================
--- ioemu.orig/vl.c	2007-05-02 16:05:50.000000000 +0100
+++ ioemu/vl.c	2007-05-02 16:05:50.000000000 +0100
@@ -39,6 +39,7 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
 #include <dirent.h>
 #include <netdb.h>
 #ifdef _BSD
@@ -2932,7 +2933,7 @@
     }
 
     /* XXX: better tmp dir construction */
-    snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%d", getpid());
+    snprintf(smb_dir, sizeof(smb_dir), "/tmp/qemu-smb.%ld", (long)getpid());
     if (mkdir(smb_dir, 0700) < 0) {
         fprintf(stderr, "qemu: could not create samba server dir '%s'\n", smb_dir);
         exit(1);
@@ -3893,7 +3894,7 @@
                 perror("Opening pidfile");
                 exit(1);
             }
-            fprintf(f, "%d\n", getpid());
+            fprintf(f, "%ld\n", (long)getpid());
             fclose(f);
             pid_filename = qemu_strdup(filename);
             if (!pid_filename) {
@@ -5308,7 +5309,9 @@
     QEMU_OPTION_d,
     QEMU_OPTION_hdachs,
     QEMU_OPTION_L,
+#ifdef USE_CODE_COPY
     QEMU_OPTION_no_code_copy,
+#endif
     QEMU_OPTION_k,
     QEMU_OPTION_localtime,
     QEMU_OPTION_cirrusvga,
@@ -5379,7 +5382,9 @@
     { "d", HAS_ARG, QEMU_OPTION_d },
     { "hdachs", HAS_ARG, QEMU_OPTION_hdachs },
     { "L", HAS_ARG, QEMU_OPTION_L },
+#ifdef USE_CODE_COPY
     { "no-code-copy", 0, QEMU_OPTION_no_code_copy },
+#endif
 #ifdef USE_KQEMU
     { "no-kqemu", 0, QEMU_OPTION_no_kqemu },
     { "kernel-kqemu", 0, QEMU_OPTION_kernel_kqemu },
@@ -5853,9 +5858,11 @@
                 fd_bootchk = 0;
                 break;
 #endif
+#ifdef USE_CODE_COPY
             case QEMU_OPTION_no_code_copy:
                 code_copy_enabled = 0;
                 break;
+#endif
             case QEMU_OPTION_net:
                 if (nb_net_clients >= MAX_NET_CLIENTS) {
                     fprintf(stderr, "qemu: too many network clients\n");
Index: ioemu/vl.h
===================================================================
--- ioemu.orig/vl.h	2007-05-02 16:05:50.000000000 +0100
+++ ioemu/vl.h	2007-05-02 16:05:50.000000000 +0100
@@ -957,7 +957,7 @@
 	       unsigned long vram_offset, int vram_size, int width, int height);
 
 /* slavio_intctl.c */
-void *slavio_intctl_init();
+void *slavio_intctl_init(void);
 void slavio_intctl_set_cpu(void *opaque, unsigned int cpu, CPUState *env);
 void slavio_pic_info(void *opaque);
 void slavio_irq_info(void *opaque);
Index: ioemu/usb-linux.c
===================================================================
--- ioemu.orig/usb-linux.c	2007-05-02 16:04:46.000000000 +0100
+++ ioemu/usb-linux.c	2007-05-02 16:05:50.000000000 +0100
@@ -26,7 +26,9 @@
 #if defined(__linux__)
 #include <dirent.h>
 #include <sys/ioctl.h>
-#include <linux/compiler.h>
+/* Some versions of usbdevice_fs.h need __user to be defined for them.   */
+/* This may (harmlessly) conflict with a definition in linux/compiler.h. */
+#define __user
 #include <linux/usbdevice_fs.h>
 #include <linux/version.h>
 
