This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Need assistance QNX libc/GNU libstdc++ header file conflicts
Benjamin Kosnik <bkoz@redhat.com> writes:
> Sorry I'm answering this so late. It seems as if you found the right
> patch on your own...
>
> > After going down this path a bit further, I realized that adding all
> > these conditionals were making c_std headers look very much like the
> > c headers. Compiling with --enable-cheaders=c allowed me to make a
> > lot of progress. Is it permissable to have a target config change
> > the --enable-cheaders default from std to c?
>
> I'm open to the suggestion. QNX is the first port to actually use this
> capability, although it was added precisely for this reason. In the
> meantime, just using configure switch should make this pretty painless
> for you (I'm pretty sure the Make/configure bits work without mods.)
One problem I ran into installing a native and a QNX cross compiler
(more generally some targets that use "c" headers and other targets
that use "c_std" headers) into the same directory prefix causes one
set to overwrite the others.
> > The only thing I'll be missing is magic to prevent the functions from
> > being exported (with "using std::foo;"). The QNX headers use a idiom
> > in <cfoo> like:
> > #ifdef _STD_USING
> > # undef _STD_USING
> > # include <foo.h>
> > # define _STD_USING
> > #else
> > # include <foo.h>
> > #endif
> >
> > And in <foo.h>:
> > #ifdef _STD_USING
> > using std::foo;
> > using std::bar;
> > using std::quux;
> > ...
> > #endif
>
> I'd rather do a separate set of <foo.h> "C" compatibility headers in
> libstdc++ that unconditionally include <cfoo>, then do the using
> declarations. Since <cfoo> uses include_next <foo.h> it should work.
Interesting. I think there still be warts. For example, in the QNX
case we'd still need to undef _STD_USING before including the system
headers or they'd still add their own using declarations. Perhaps
with a full set of compatibility headers, we could unconditionally
undef _STDC_USING.
> I actually have some of this done already. I can send you my bits if
> you'd like. Because I could never get the last 5% (glibc headers turned
> out to be too difficult to untangle) I never checked it in.
I'm not sure I could help in that department, as I don't run any systems
that use glibc.
> Do you have a working set of sources? If so, and you can post a patch,
> I'll review it for you and post the mods publically. It might speed up
> your development.
Indeed I do. Are libstdc++ patches generally posted to this list, or
to gcc-patches?
--jtc
--
J.T. Conklin