This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/78905] Add a macro to determine that the <regex> library is implemented
- From: "mattyclarkson at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 Jan 2017 20:25:53 +0000
- Subject: [Bug libstdc++/78905] Add a macro to determine that the <regex> library is implemented
- Auto-submitted: auto-generated
- References: <bug-78905-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78905
--- Comment #9 from Matt Clarkson <mattyclarkson at gmail dot com> ---
(In reply to Jonathan Wakely from comment #7)
> GCC 7 now defines _GLIBCXX_RELEASE (with the same value as __GNUC__ has,
> i.e. the GCC major version, as an integer constant, but defined by the
> library headers not the compiler).
>
> If that macro is present you have a version of libstdc++ that provides a
> working <regex>. To be really sure you could check it's defined to a value
> >= 5, in order to handle (hypothetical) unofficial 4.7 or 4.8 builds that
> have the patch backported.
Sweet! Will update the snippet on Stack Overflow. Thank you for this, you the
man ;)