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

Re: [Xen-devel] [PATCH] libxc, libxenstore: make the headers C++-friendly



At 18:44 +0200 on 22 Jan (1358880251), Razvan Cojocaru wrote:
> diff -r 4b476378fc35 -r 93e5f6cf98d2 xen/include/public/hvm/save.h
> --- a/xen/include/public/hvm/save.h   Mon Jan 21 17:03:10 2013 +0000
> +++ b/xen/include/public/hvm/save.h   Tue Jan 22 18:43:45 2013 +0200
> @@ -28,6 +28,10 @@
>  #ifndef __XEN_PUBLIC_HVM_SAVE_H__
>  #define __XEN_PUBLIC_HVM_SAVE_H__
>  
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +

The Xen public headers are in C, not C++. Doesn't this kind of
boilerplace belong in the C++ file that's trying to include a C header?

Tim.

>  /*
>   * Structures in this header *must* have the same layout in 32bit 
>   * and 64bit environments: this means that all fields must be explicitly 
> @@ -108,4 +112,8 @@ DECLARE_HVM_SAVE_TYPE(END, 0, struct hvm
>  #error "unsupported architecture"
>  #endif
>  
> +#ifdef __cplusplus
> +}
> +#endif
> +
>  #endif /* __XEN_PUBLIC_HVM_SAVE_H__ */
> diff -r 4b476378fc35 -r 93e5f6cf98d2 xen/include/public/io/ring.h
> --- a/xen/include/public/io/ring.h    Mon Jan 21 17:03:10 2013 +0000
> +++ b/xen/include/public/io/ring.h    Tue Jan 22 18:43:45 2013 +0200
> @@ -111,7 +111,7 @@ struct __name##_sring {                 
>              uint8_t msg;                                                \
>          } tapif_user;                                                   \
>          uint8_t pvt_pad[4];                                             \
> -    } private;                                                          \
> +    } rprivate;                                                          \
>      uint8_t __pad[44];                                                  \
>      union __name##_sring_entry ring[1]; /* variable-length */           \
>  };                                                                      \
> @@ -156,7 +156,7 @@ typedef struct __name##_back_ring __name
>  #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)->rprivate.pvt_pad, 0, sizeof((_s)->rprivate.pvt_pad)); 
> \
>      (void)memset((_s)->__pad, 0, sizeof((_s)->__pad));                  \
>  } while(0)
>  
> diff -r 4b476378fc35 -r 93e5f6cf98d2 xen/include/public/mem_event.h
> --- a/xen/include/public/mem_event.h  Mon Jan 21 17:03:10 2013 +0000
> +++ b/xen/include/public/mem_event.h  Tue Jan 22 18:43:45 2013 +0200
> @@ -27,6 +27,10 @@
>  #ifndef _XEN_PUBLIC_MEM_EVENT_H
>  #define _XEN_PUBLIC_MEM_EVENT_H
>  
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
>  #include "xen.h"
>  #include "io/ring.h"
>  
> @@ -69,6 +73,10 @@ typedef struct mem_event_st {
>  
>  DEFINE_RING_TYPES(mem_event, mem_event_request_t, mem_event_response_t);
>  
> +#ifdef __cplusplus
> +}
> +#endif
> +
>  #endif
>  
>  /*
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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