From: Tim Deegan Date: Thu, 5 Mar 2015 12:11:25 +0000 (+0000) Subject: xen: don't use C++ keyword 'private' in public headers. X-Git-Tag: 4.6.0-rc1~988 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=156e90e8f9ad74c7f91633630a882bdbb6caf5ff;p=xen.git xen: don't use C++ keyword 'private' in public headers. The 'private' field in io/ring.h (for blktap2, see 1b9cecdb) is the last thing in the Xen public headers that a C++ compiler will object to. Rename it to pvt, update the only in-tree user, and remove the workaround in the C++ compatibility check. Signed-off-by: Tim Deegan Acked-by: Ian Campbell --- diff --git a/tools/blktap2/drivers/tapdisk-vbd.c b/tools/blktap2/drivers/tapdisk-vbd.c index c665f270cc..6d1d94ad2f 100644 --- a/tools/blktap2/drivers/tapdisk-vbd.c +++ b/tools/blktap2/drivers/tapdisk-vbd.c @@ -1684,7 +1684,7 @@ tapdisk_vbd_check_ring_message(td_vbd_t *vbd) if (!vbd->ring.sring) return -EINVAL; - switch (vbd->ring.sring->private.tapif_user.msg) { + switch (vbd->ring.sring->pvt.tapif_user.msg) { case 0: return 0; diff --git a/xen/include/Makefile b/xen/include/Makefile index d48a642b56..c7a1d527dd 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -104,8 +104,7 @@ headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile headers++.chk: $(PUBLIC_HEADERS) Makefile if $(CXX) -v >/dev/null 2>&1; then \ for i in $(filter %.h,$^); do \ - $(CXX) -x c++ -std=gnu++98 -Wall -Werror \ - -D__XEN_TOOLS__ -Dprivate=private_is_a_keyword_in_cpp \ + $(CXX) -x c++ -std=gnu++98 -Wall -Werror -D__XEN_TOOLS__ \ -include stdint.h -include public/xen.h \ -S -o /dev/null $$i || exit 1; \ echo $$i; \ diff --git a/xen/include/public/io/ring.h b/xen/include/public/io/ring.h index 73e13d7ae4..ba9401b779 100644 --- a/xen/include/public/io/ring.h +++ b/xen/include/public/io/ring.h @@ -111,7 +111,7 @@ struct __name##_sring { \ uint8_t msg; \ } tapif_user; \ uint8_t pvt_pad[4]; \ - } private; \ + } pvt; \ uint8_t __pad[44]; \ union __name##_sring_entry ring[1]; /* variable-length */ \ }; \ @@ -156,7 +156,7 @@ typedef struct __name##_back_ring __name##_back_ring_t #define SHARED_RING_INIT(_s) do { \ (_s)->req_prod = (_s)->rsp_prod = 0; \ (_s)->req_event = (_s)->rsp_event = 1; \ - (void)memset((_s)->private.pvt_pad, 0, sizeof((_s)->private.pvt_pad)); \ + (void)memset((_s)->pvt.pvt_pad, 0, sizeof((_s)->pvt.pvt_pad)); \ (void)memset((_s)->__pad, 0, sizeof((_s)->__pad)); \ } while(0)