All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rzvncj@gmail.com>
To: Tim Deegan <tim@xen.org>
Cc: Jan Beulich <JBeulich@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] libxc, libxenstore: make the headers C++-friendly
Date: Tue, 22 Jan 2013 19:44:51 +0200	[thread overview]
Message-ID: <50FED013.6000101@gmail.com> (raw)
In-Reply-To: <20130122173130.GF87324@ocelot.phlegethon.org>

> Well, obviously you shouldn't leave it lying around.  Can you do
> something like
>
> extern "C" {
> #define private mumblywurzle
> #include <xen/ring.h>
> #undef private
> }

There are other headers that indirectly include ring.h. My code never 
includes it directly, and, as you have seen, the errors were far from 
specific. Trying to figure out who brought what header in and what the 
error means, and fighting to be able to use C++ properly on top of that 
is surely not something any of us prefers.

> Once again, this isn't C++.  If there has to be an ugly workaround, put
> it in the C++ code.

There should be no ugly workaround. I'll probably leave all the headers 
alone, implement my own C wrapper that exposes extern "C" functions and 
hides all the macro stuff, and build my C++ application on top of that 
intermediate layer.

I just asked because I thought there might be some interest in being 
able to use the Xen code directly from C++ projects; if there isn't, 
that's fair enough.

Thank you for all your comments!

Cheers,
Razvan Cojocaru

  reply	other threads:[~2013-01-22 17:44 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
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 [this message]
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=50FED013.6000101@gmail.com \
    --to=rzvncj@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=tim@xen.org \
    --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.