[patch RFC] cpp macro surgery

Phil Edwards pedwards@disaster.jaj.com
Fri Mar 2 18:01:00 GMT 2001

This patch (mainline only right now) does a number of things:

1)  Style cleanups as per C++STYLE items.  Very few of these.  (Wrong
indentation, chunks of blank lines, nothing killer.)

2)  More comments in c++config as to what macro has what effect.

3)  Most importantly, lots of cpp macro cleanup all through the headers;
this also cleans out lots of macros definitions in c++config.  The generic
SGI STL is just chock full of stuff like

    #if we have partial ordering of template functions
    do cool things
    kludge around it


    #if ! (we're using GCC 2.7 or SGI 5.3 or (some compiler from the
           beginning of the Epoch))
    standard-conforming code

There's no sense in having cpplib do the exact same tests over and over and
always coming up with the same known results.  So conditionally compiled
code that /never/ happens is removed with this patch, 'prox 160KB worth.

This also replaces backwards-combatible macros like

    #define __STD_QUALIFIER std::

with their values directly; there's no way the current code could be
compiled without namespaces, so there's no point in supporting hooks
to disable them, etc.  Likewise for templates, certain keywords, etc.
Makes the code much easier to read.

The only remaining conditional-compilation macros are

    - ones we control ourselves via autoconf (WCHAR_T, LONG_LONG, etc)
    - one or two hooks from SGI that seem useful to leave in (commented
      in c++config now)
    - things dealing with the two SGI STL pthread headers; those are
      hideous and I don't feel like dealing with them right now, also
      they aren't used much

All the files that I touched that already had an FSF copyright had 2001
added to the year (most already had it).

For changes like __STD::foo -> std::foo, naturally the whole line is
included twice in the diff, so the patch is about 300K and needed zipping.

Questions, comments, witty remarks?

boy I'm not looking forward to writing the changelog entry for this... :-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: massive_patch.bz2
Type: application/x-bzip2
Size: 38848 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20010302/0d3d73e0/attachment.bz2>

More information about the Libstdc++ mailing list