@@ -47,6 +47,9 @@
#include "chardev/char-fd.h"
#include "chardev/char-parallel.h"
+#define PARALLEL_CHARDEV(obj) \
+ OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
+
#if defined(__linux__)
typedef struct {
@@ -55,9 +58,6 @@ typedef struct {
int mode;
} ParallelChardev;
-#define PARALLEL_CHARDEV(obj) \
- OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
-
static int pp_hw_mode(ParallelChardev *s, uint16_t mode)
{
if (s->mode != mode) {
@@ -182,9 +182,6 @@ typedef struct {
int fd;
} ParallelChardev;
-#define PARALLEL_CHARDEV(obj) \
- OBJECT_CHECK(ParallelChardev, (obj), TYPE_CHARDEV_PARALLEL)
-
static int pp_ioctl(Chardev *chr, int cmd, void *arg)
{
ParallelChardev *drv = PARALLEL_CHARDEV(chr);
The macro is exactly the same for both Linux and BSD, so move its definition outside the host OS #ifdef blocks. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> --- chardev/char-parallel.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)