From: "Jan Beulich" Subject: Re: [PATCH] xen: Minor modifications to platform.h to make it C++-friendly Date: Mon, 23 Feb 2015 10:16:31 +0000 Message-ID: <54EB0C0F0200007800062651@mail.emea.novell.com> References: <1424684065-5971-1-git-send-email-rcojocaru@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1424684065-5971-1-git-send-email-rcojocaru@bitdefender.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Razvan Cojocaru Cc: keir@xen.org, tim@xen.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 23.02.15 at 10:34, wrote: > Moved the definition of struct xenpf_efi_guid up, and rearranged > struct xenpf_efi_time in the containing union to avoid compilation > errors with C++ (structs defined inside unnamed structs become > unavailable outside their scope with C++). The change allows C++ > applications to use platform.h with no consequences for current > C clients. What's wrong with simply naming the union/struct, making for a much smaller change? > @@ -152,24 +159,24 @@ struct xenpf_efi_runtime_call { > xen_ulong_t status; > union { > #define XEN_EFI_GET_TIME_SET_CLEARS_NS 0x00000001 > + struct xenpf_efi_time { > + uint16_t year; > + uint8_t month; > + uint8_t day; > + uint8_t hour; > + uint8_t min; > + uint8_t sec; > + uint32_t ns; > + int16_t tz; > + uint8_t daylight; > + } set_time; > + If we were to go this proposed route, the insertion would need to happen above the #define. Jan