[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen: don't use C++ keyword 'private' in public headers.



commit 156e90e8f9ad74c7f91633630a882bdbb6caf5ff
Author:     Tim Deegan <tim@xxxxxxx>
AuthorDate: Thu Mar 5 12:11:25 2015 +0000
Commit:     Tim Deegan <tim@xxxxxxx>
CommitDate: Thu Mar 12 11:08:23 2015 +0000

    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 <tim@xxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/blktap2/drivers/tapdisk-vbd.c |    2 +-
 xen/include/Makefile                |    3 +--
 xen/include/public/io/ring.h        |    4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/blktap2/drivers/tapdisk-vbd.c 
b/tools/blktap2/drivers/tapdisk-vbd.c
index c665f27..6d1d94a 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 d48a642..c7a1d52 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 73e13d7..ba9401b 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)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.