]> xenbits.xensource.com Git - people/gdunlap/xen.git/commitdiff
xen: don't use C++ keyword 'private' in public headers.
authorTim Deegan <tim@xen.org>
Thu, 5 Mar 2015 12:11:25 +0000 (12:11 +0000)
committerTim Deegan <tim@xen.org>
Thu, 12 Mar 2015 11:08:23 +0000 (11:08 +0000)
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 <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/blktap2/drivers/tapdisk-vbd.c
xen/include/Makefile
xen/include/public/io/ring.h

index c665f270cc6fa21802e069a4b53d542b4c566a90..6d1d94ad2f608c084c5a33ee6d18238dae34b2d5 100644 (file)
@@ -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;
 
index d48a642b56ed573422af59fcdd3d0ae0ab0114ea..c7a1d527dd646a23ef6c72d7abad1a4537b2d978 100644 (file)
@@ -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; \
index 73e13d7ae432bbdb48d63be0f8d1e6fb518470f2..ba9401b7791a1c5388db9676456b97264d2a346c 100644 (file)
@@ -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)