The struct itself may have a different definition on each OS, but
we can define the typedef in common code, outside the host OS #ifdefs.

Signed-off-by: Eduardo Habkost <ehabk...@redhat.com>
---
 chardev/char-parallel.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/chardev/char-parallel.c b/chardev/char-parallel.c
index 390d03506c..e32aa2d226 100644
--- a/chardev/char-parallel.c
+++ b/chardev/char-parallel.c
@@ -47,16 +47,17 @@
 #include "chardev/char-fd.h"
 #include "chardev/char-parallel.h"
 
+typedef struct ParallelChardev ParallelChardev;
 #define PARALLEL_CHARDEV(obj) \
     OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
 
 #if defined(__linux__)
 
-typedef struct {
+struct ParallelChardev {
     Chardev parent;
     int fd;
     int mode;
-} ParallelChardev;
+};
 
 static int pp_hw_mode(ParallelChardev *s, uint16_t mode)
 {
@@ -177,10 +178,10 @@ static void qemu_chr_open_pp_fd(Chardev *chr,
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || 
defined(__DragonFly__)
 
-typedef struct {
+struct ParallelChardev {
     Chardev parent;
     int fd;
-} ParallelChardev;
+};
 
 static int pp_ioctl(Chardev *chr, int cmd, void *arg)
 {
-- 
2.26.2


Reply via email to