This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: __cplusplus revisited (on Solaris 8)




> The Sun WS6 compiler supplies its own standard C++ header files which do nothing but include the /usr/include/iso
> header files directly.

This is what the include/c headers were supposed to do. They might not be 
in the correct form at the moment to be useful though.

> By patching a couple of system headers I can manage to get a bootstrap of the 3.x complier (with the c_std headers),
> but simple test programs will not compile due to name clashes.  Any attempt to use the "c" or "c_shadow" C++ headers
> instead of the "c_std" headers will not event bootstrap due to massive name clashes throughout the headers.  The "c"
> headers won't work because they leave everything in std in the global namespace as well, so you can't include, say,
> <unistd.h> and <cstdio> in the same program.  The "c_shadow" headers have other, more bizarre problems the cause of
> which I'm still trying to track, but I don't think they really do what we want (although they should, in theory, do
> what we need in a very roundabout way).

OK. Please let me point out the include diretory differences:

1) c     == pass through, include "C" header
2) c_std == equiv "C" header in global, required names injected into std
3) c_shadow == not working, "C" headers in own namespace, required names 
injected into std

To me, there is only one option for the Solaris 8 headers, and that is 
option one. Option 3 has only randomly worked, and only on linux: porting 
it to solaris 8 seems like way more trouble than it's worth. Option 2 seems 
pretty solid now, and I'd be disinclined to see major patches to it at 
this point.

Hope that clarifies things.

Since nobody uses option one, I suggest hacking that option to make it 
work for solaris 8, or...

> I think what we need in the case of Soalris 8 is a fourth set of C++ headers that are designed to wrap the
> D.1.5.2-compliant  headers and just let the std names show through.  They would just do something like
> 
> // for <cstring>
> 
> namespace _system_header_
> {
> # include <string.h>
> }
> 
> namespace std
> {
>   using namespace _system_header_::std;
> }
> 
> // end of <cstring>

...or this. Perhaps you are right, we need a fourth. (Please use the 
naming conventions in the c_shadow directory though for the namespaces) If 
these solaris headers are in fact correct, then doing this should be relatively 
painless, and your problems are indicative of v3 trying to smash a square 
peg into a round hole. Let's not do that.

Can you work up this last (Option/Solution 4) and see if that solves this 
insanity?

-benjamin


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