This is the mail archive of the
mailing list for the libstdc++ project.
Re: [patch] libstdc++/65473 Make <ciso646> define libstdc++ version macros.
- From: Martin Sebor <msebor at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>, libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 03 Sep 2015 13:22:12 -0600
- Subject: Re: [patch] libstdc++/65473 Make <ciso646> define libstdc++ version macros.
- Authentication-results: sourceware.org; auth=none
- References: <20150903105847 dot GN2631 at redhat dot com>
On 09/03/2015 04:58 AM, Jonathan Wakely wrote:
This change would allow including <ciso646> to be used to check for
__GLIBCXX__ and detect whether youre using libstdc++ or not. Howard
Hinnant recommends including that header for libc++ because it has no
other effects in C++.
We could make every <cxxx> header include <bits/c++config.h> so that
any of them can be used, but I can't be bothered doing that change!
This makes it work for the one header that is recommended to be used,
but of course that doesn't help people using older versions of
libstdc++, who still need to include some other header.
Is this worth doing?
I'd say it's worth doing consistently, in every header. Users are
told by others (e.g., on various discussion forums) to expect to
be able to check what C++ library implementation they're using by
including any C++ standard header and testing the known version
PS Out of curiosity I looked to see which headers don't include
$ (for f in cassert ccomplex cctype cerrno cfenv cfloat cinttypes
ciso646 climits clocale cmath csetjmp csignal cstdalign cstdarg cstdbool
cstddef cstdint cstdio cstdlib cstring ctgmath ctime cuchar; do printf "
%-20s " "<$f>" && echo "#include <$f>" | ~/bin/gcc-5.1.0/bin/g++ -E
-std=c++14 -xc++ - | grep -l "c++config\.h" | wc -l; done )
<cuchar> <stdin>:1:18: fatal error: cuchar: No such file