This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
std::exception_ptr on Cygwin
- From: Piotr Wyderski <piotr dot wyderski at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 29 May 2009 01:00:06 +0200
- Subject: std::exception_ptr on Cygwin
It is impossible to use std::exception_ptr and related
functionality on Cygwin in C++0x mode, despite the
fact the necessary classes seem to be implemented.
That is because in <exception> there is a conditional
block:
#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
&& defined(_GLIBCXX_ATOMIC_BUILTINS_4))
#include <exception_ptr.h>
#endif
The macro __GXX_EXPERIMENTAL_CXX0X__ is
defined correctly, as expected, but
_GLIBCXX_ATOMIC_BUILTINS_4
is not, as Cygwin does not use glibc. Its underlying
processor architecture, however, supports the fullest
set of atomic primitives, so is there really a need to
make it glibc-dependent? If I enforce the macro
definition from the command line, then the exception_ptr
-dependent code compiles correctly (but does not link
because of
undefined reference to `std::__exception_ptr::exception_ptr::~exception_ptr()
and the other non-inline members. I presume
it is not the recommended way.
Best regards
Piotr Wyderski