Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix boost (>= 1.66) on gcc 4.9.3 #225

Open
muffgaga opened this issue May 2, 2018 · 1 comment
Open

Fix boost (>= 1.66) on gcc 4.9.3 #225

muffgaga opened this issue May 2, 2018 · 1 comment

Comments

@muffgaga
Copy link

muffgaga commented May 2, 2018

When trying to use boost 1.66 on gcc 4.9.3 (not sure about 4.9.4; we use gcc 4.9.3 as it is the last "known good" version for gccxml) we encountered a strange bug related to gcc's handling of __has_include:
The macro is defined but not implemented correctly.
Our workaround was to conditionally undefine the macro when encountering gcc 4.9.x.

diff -rpu boost_1_66_0_old/boost/config/stdlib/libstdcpp3.hpp boost_1_66_0/boost/config/stdlib/libstdcpp3.hpp
--- boost_1_66_0_old/boost/config/stdlib/libstdcpp3.hpp	2017-12-14 00:56:42.000000000 +0100
+++ boost_1_66_0/boost/config/stdlib/libstdcpp3.hpp	2018-04-25 16:42:42.627694409 +0200
@@ -301,6 +301,11 @@ extern "C" char *gets (char *__s);
 #  define BOOST_NO_CXX17_STD_APPLY
 #endif
 
+#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 9) && defined(__has_include)
+// gcc 4.9.x defines but does not implement it
+#undef __has_include
+#endif
+
 #if defined(__has_include)
 #if !__has_include(<shared_mutex>)
 #  define BOOST_NO_CXX14_HDR_SHARED_MUTEX
@jzmaddock
Copy link
Collaborator

That's nasty, but the fix looks almost as bad.... not sure what to do about this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants