Skip to contentSkip to conversation

osdep.h: include sys/types.h for ssize_t definition

PATCH Superseded Igor Mitsyanko 2 participants 3 messages May 10, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 osdep.h: include sys/types.h for ssize_t definition

This fixes build for mingw32

---
 include/qemu/osdep.h | 2 ++
 1 file changed, 2 insertions(+)
include/qemu/osdep.h +2 -0
index 42545bc..17946a3 100644
@@ -163,6 +163,8 @@ int qemu_create_pidfile(const char *filename);
 int qemu_get_thread_id(void);
 
 #ifndef CONFIG_IOVEC
+#include <sys/types.h>
+
 struct iovec {
     void *iov_base;
     size_t iov_len;
Signature · 1 line
1.8.1.4
#1 lore raw
Quoted 12 lines · Igor Mitsyanko

This fixes build for mingw32

---
 include/qemu/osdep.h | 2 ++
 1 file changed, 2 insertions(+)
include/qemu/osdep.h +0 -0
index 42545bc..17946a3 100644

include/qemu/osdep.h int qemu_create_pidfile(const char *filename); · line 167

Quoted 5 lines
include/qemu/osdep.h +2 -0
@@ -163,6 +163,8 @@ int qemu_create_pidfile(const char *filename);
 int qemu_get_thread_id(void);
 
 #ifndef CONFIG_IOVEC
+#include <sys/types.h>
+

This is quite a long way down to have a system #include.

Can we just take the existing include of sys/types.h at the top of the file out of its current #ifdef __OpenBSD__ guard ?

(http://hacks.owlfolio.org/header-survey/ has a full row of greens for sys/types.h so this should be safe.)

thanks
-- PMM

#2 lore raw
Quoted 24 lines · Peter Maydell
Quoted 12 lines · Igor Mitsyanko

This fixes build for mingw32

---
  include/qemu/osdep.h | 2 ++
  1 file changed, 2 insertions(+)
include/qemu/osdep.h +0 -0
index 42545bc..17946a3 100644

include/qemu/osdep.h int qemu_create_pidfile(const char *filename); · line 167

Quoted 5 lines
include/qemu/osdep.h +2 -0
@@ -163,6 +163,8 @@ int qemu_create_pidfile(const char *filename);
  int qemu_get_thread_id(void);
 
  #ifndef CONFIG_IOVEC
+#include <sys/types.h>
+

This is quite a long way down to have a system #include.

Can we just take the existing include of sys/types.h at the top of the file out of its current #ifdef __OpenBSD__ guard ?

Quoted 5 lines

(http://hacks.owlfolio.org/header-survey/ has a full row of greens for sys/types.h so this should be safe.)

thanks
-- PMM

Nice link.
Long way, yes, but there's "#include <sys/uio.h>" even further down in this file. But I guess taking existing sys/types.h is still better, I'll resend it.