diff mbox

[for-1.5,2/2] w32: Include stdio.h to get the declaration of ssize_t

Message ID 1368301619-32097-3-git-send-email-sw@weilnetz.de
State New
Headers show

Commit Message

Stefan Weil May 11, 2013, 7:46 p.m. UTC
Latest native MinGW and also the Debian squeeze cross version declare
ssize_t in sys/types.h which is not included by osdep.h. This results
in a compiler error for several files:

  CC    util/hbitmap.o
In file included from C:/qemu/util/hbitmap.c:15:0:
C:/qemu/include/qemu/osdep.h:175:1: error: unknown type name 'ssize_t'
C:/qemu/include/qemu/osdep.h:176:1: error: unknown type name 'ssize_t'
make: *** [util/hbitmap.o] Error 1

Including stdio.h is a trick which gets the necessary declaration in a
portable way. It also includes stdarg.h, so that include statement can
be safely removed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 include/qemu/osdep.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 42545bc..822512f 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -2,9 +2,9 @@ 
 #define QEMU_OSDEP_H
 
 #include "config-host.h"
-#include <stdarg.h>
 #include <stddef.h>
 #include <stdbool.h>
+#include <stdio.h>
 #ifdef __OpenBSD__
 #include <sys/types.h>
 #include <sys/signal.h>