本文介绍了每个libstdc ++版本的`__GLIBCXX__`的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

__ GLIBCXX __ 包含libstdc ++版本的时间戳,例如,来自gcc文档( https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html )

The macro __GLIBCXX__ contains the time stamp of libstdc++ releases, e.g., from gcc documentation (https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html)

我正在寻找自4.9.0版本以来的所有版本的值(包括4.8.x等较小版本的版本).

I am looking for the values for all releases since the release of 4.9.0 (including releases of smaller versions like 4.8.x).

libstdc ++的文档似乎没有提供此信息(它仅提供gcc 4.7.0之前的日期).

The documentation of libstdc++ does not seem to provide this information (it only provides the dates up to gcc 4.7.0).

在哪里可以找到 __ GLIBCXX __ 的值?有人有吗?

Where can I find the values of __GLIBCXX__? Does anybody have them?

ABI政策和准则附录( https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html )说

The ABI Policy and Guidelines appendix (https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) says

,但是仅提供高达GCC 4.7.0的宏的值.仍在此处列出特定GCC版本的发布日期:

but then only provides the values of the macro up to GCC 4.7.0. Still the day of a particular GCC releases are listed here:

https://gcc.gnu.org/releases.html

但是例如,对于发布日期为"2014年7月16日"的GCC 4.9.1,ISO日期格式为20140716, __ GLIBCXX __ 的值为20140617(请注意,已更改7和6)

but for example for GCC 4.9.1 with release date "July 16, 2014" the ISO date format is 20140716 and the value of __GLIBCXX__ is 20140617 (notice the 7 and 6 have been switched).

推荐答案

想要的信息无论如何都是无用的,因此您应该以其他方式解决问题.

The information you want is useless anyway, so you should solve your problem a different way.

GCC 4.9.3是在GCC 5.3之后发布的,因此它在该宏中具有较晚的日期,因此您不能只执行以下操作:

GCC 4.9.3 was released after GCC 5.3, so it has a later date in that macro, so you can't just do something like:

#if __GLIBCXX__ > 20150422 // GCC 5.1 release

因为对于4.9.3来说是正确的,但是并不具备5.1的所有功能.

because that would be true for 4.9.3, but that doesn't have all the features that 5.1 has.

大多数GNU/Linux发行版也不发行FSF官方发行版,而是构建快照,其中将包含快照的日期,而不会在发行日期的任何列表中.并且给定日期的5.x分支的快照与给定日期的6.x分支的快照具有相同的日期,因此您无法区分它们.

Most GNU/Linux distros don't ship official FSF releases either, they build snapshots, which will have the date of the snapshot, which won't be in any list of release dates. And a snapshot from the 5.x branch on a given day will have the same date as a snapshot from the 6.x branch on a given day, so you can't tell them apart.

这篇关于每个libstdc ++版本的`__GLIBCXX__`的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 06:40