This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: merging C/C++ code


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]