]> xenbits.xensource.com Git - xen.git/commitdiff
tools/libs/vchan: remove private offsetof() definition
authorJuergen Gross <jgross@suse.com>
Fri, 24 Mar 2023 10:14:25 +0000 (11:14 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 24 Mar 2023 10:14:25 +0000 (11:14 +0100)
vchan/init.c is defining offsetof privately. Remove that definition
and just use stddef.h instead.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
tools/libs/vchan/init.c

index 021e1f29e1cd22e54cb69e3267576342678e0d40..a081dd4c9ab0b3619cec161782d3a17cd77fb33c 100644 (file)
@@ -32,6 +32,7 @@
 #include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/user.h>
+#include <stddef.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdint.h>
 #define MAX_RING_SHIFT 20
 #define MAX_RING_SIZE (1 << MAX_RING_SHIFT)
 
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
-
 static int init_gnt_srv(struct libxenvchan *ctrl, int domain)
 {
        int pages_left = ctrl->read.order >= PAGE_SHIFT ? 1 << (ctrl->read.order - PAGE_SHIFT) : 0;