sgi extensions

Jonathan Wakely cow@compsoc.man.ac.uk
Thu Nov 28 11:30:00 GMT 2002


On Wed, Nov 27, 2002 at 11:25:01AM -0600, Benjamin Kosnik wrote:

> >Should there be separate tests for 3.0 and 3.1, IIRC the extensions were
> >still in the std namespace until 3.1?
> 
> This is correct, and should at least be noted as a comment.

If I can't even be bothered to type out a properly portable version
for the docs I can't ask anyone to!

I'm about to commit it as follows

      #ifdef __GNUC__
      #if __GNUC__ < 3
        #include <hash_map.h>
        namespace Sgi { using ::hash_map; }; // inherit globals
      #else
        #include <ext/hash_map>
        #if __GNUC_MINOR__ == 0
          namespace Sgi = std;               // GCC 3.0
        #else
          namespace Sgi = ::__gnu_cxx;       // GCC 3.1 and later
        #endif
      #endif
      #else      // ...  there are other compilers, right?
        namespace Sgi = std;
      #endif

jon


--
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
	- M.A. Jackson



More information about the Libstdc++ mailing list