From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH] libxc, libxenstore: make the headers C++-friendly Date: Tue, 22 Jan 2013 19:07:07 +0200 Message-ID: <50FEC73B.7020208@gmail.com> References: <93e5f6cf98d2ae3539db.1358873051@rcojocaru.dsd.ro> <50FED22102000078000B86C8@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50FED22102000078000B86C8@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >> - struct hvm_hw_cpu *new=h; >> - struct hvm_hw_cpu_compat *old=h; >> + struct hvm_hw_cpu *newcpu=(struct hvm_hw_cpu *)h; >> + struct hvm_hw_cpu_compat *old=(struct hvm_hw_cpu_compat *)h; > > That's not really C++. But yes, I recognize that the alternative > would be an even uglier #ifdef. Is this about reinterpret_cast(h)? I'm not trying to turn a C header into a C++ header, I'm trying to make a C header usable with C++, obviously. >> + newcpu->error_code=old->error_code; >> + newcpu->pending_event=old->pending_event; >> + newcpu->tsc=old->tsc; >> + newcpu->msr_tsc_aux=0; > > Here and above - if you already touch those, could you add > spaces around the = operators? Of course. >> - } private; \ >> + } rprivate; \ > > This is a no-go: In a public header, you can't change names like > this. Since the stuff under io/ isn't really tied to > __XEN_INTERFACE_VERSION__, I'm also not immediately seeing > how else you could adjust this. That ammounts to not being able to use libxc with C++ if you ever use ring.h's DEFINE_RING_TYPES() macro (that is, if you ever use mem_events). Cheers, Razvan Cojocaru