All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rzvncj@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] libxc, libxenstore: make the headers C++-friendly
Date: Tue, 22 Jan 2013 19:07:07 +0200	[thread overview]
Message-ID: <50FEC73B.7020208@gmail.com> (raw)
In-Reply-To: <50FED22102000078000B86C8@nat28.tlf.novell.com>

>> -    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<type>(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

  parent reply	other threads:[~2013-01-22 17:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 16:44 [PATCH] libxc, libxenstore: make the headers C++-friendly Razvan Cojocaru
2013-01-22 16:53 ` Jan Beulich
2013-01-22 17:02   ` Ian Campbell
2013-01-22 17:18     ` Razvan Cojocaru
2013-01-22 17:19     ` Jan Beulich
2013-01-22 17:07   ` Razvan Cojocaru [this message]
2013-01-22 17:12     ` Jan Beulich
2013-01-22 17:21       ` Razvan Cojocaru
2013-01-22 17:24         ` Ian Campbell
2013-01-22 17:29           ` Razvan Cojocaru
2013-01-22 17:30             ` Andrew Cooper
2013-01-22 17:26         ` Jan Beulich
2013-01-22 17:26       ` Razvan Cojocaru
2013-01-22 17:31         ` Tim Deegan
2013-01-22 17:44           ` Razvan Cojocaru
2013-01-23  8:25         ` Jan Beulich
2013-01-22 16:57 ` Tim Deegan
2013-01-22 17:12   ` Razvan Cojocaru
2013-01-22 17:28     ` Tim Deegan
2013-01-22 17:34       ` Razvan Cojocaru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50FEC73B.7020208@gmail.com \
    --to=rzvncj@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.