This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: What should go in our <version> header?


On 06/15/2018 11:52 AM, Jonathan Wakely wrote:
C++20 adds a <version> header, which should define all the library
feature test macros, as well as implementation-specific macros like
_GLIBCXX_RELEASE and __GLIBCXX__.

We should decide whether to implement <version> by simply including
<bits/c++config.h> and then adding the feature test macros, or if we
should keep it minimal and *only* define _GLIBCXX_RELEASE and
__GLIBCXX__ and the feature tests (and then have <bits/c++config.h>
include <version>?)

I think I prefer to make <version> just include <bits/c++config.h>.

I think we should define the feature-test macros in both <version> and
the relevant header (e.g. __cpp_string_view in <string_view>). We
could make everything include <version> and then every header would
define every feature test macro, but I don't think that's good for
portability.

My preference is implemented by the attached patch.

This is pretty much what I was looking at doing.  I say go!

While on the subject, should we just delete some of this autoconf-junk
from our c++config.h headers?

/* Name of package */
/* #undef _GLIBCXX_PACKAGE */

/* Define to the address where bug reports for this package should be sent. */
#define _GLIBCXX_PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define _GLIBCXX_PACKAGE_NAME "package-unused"

/* Define to the full name and version of this package. */
#define _GLIBCXX_PACKAGE_STRING "package-unused version-unused"

/* Define to the one symbol short name of this package. */
#define _GLIBCXX_PACKAGE_TARNAME "libstdc++"

/* Define to the home page for this package. */
#define _GLIBCXX_PACKAGE_URL ""

/* Define to the version of this package. */
#define _GLIBCXX_PACKAGE__GLIBCXX_VERSION "version-unused"

I don't have an opinion here except if this is unused cruft let's lose it.  I think we *are* supposed to have some project and version identification.  We have _GLIBCXX_* everywhere.  The folks that use libstdc++ *outside* of g++ might have some opinions about this too.

Ed



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