This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[patch RFC] cpp macro surgery
- To: libstdc++ at gcc dot gnu dot org
- Subject: [patch RFC] cpp macro surgery
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: Fri, 2 Mar 2001 21:13:38 -0500
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
#else
kludge around it
#endif
and
#if ! (we're using GCC 2.7 or SGI 5.3 or (some compiler from the
beginning of the Epoch))
standard-conforming code
#endif
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?
Phil
boy I'm not looking forward to writing the changelog entry for this... :-)
massive_patch.bz2