This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: merging C/C++ code
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Dieter Stüken <stueken at conterra dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 21 Feb 2005 17:46:57 +0000
- Subject: Re: merging C/C++ code
- Organization: Codesourcery LLC
- References: <421A1C3B.5040700@conterra.de>
Dieter Stüken wrote:
I developed a C++ wrapper around some old C-code using:
It worked great, until the developers of that C-Api meanwhile
also got same idea and included lots of "#ifdef __cplusplus"
and some wrapper classes, too. Unfortunately they are useless to
me and even quite buggy. CGG even refuses to compile them :-(
Although it seems to work, this solution looks very odd to me.
Is there a better way to handle this? I also worry about additional
system headers which may then be included randomly within different
contexts....
If I understand correctly, you're trying to use some header files in
a C++ program that think they are C++ aware, but are, infact, not. Any
solution that does not actually fix those headers is going to be a hack.
You can either
1) stick with the old headers
2) beat the C-API authors with a C++ std :)
3) hack something akin to what you have, and keep your fingers crossed.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk