Hi,

I found an issue that the __cxa_thread_atexit_impl() function never called by
__cxa_thread_atexit() even with newest glibc which have __cxa_thread_atexit_impl
implemented.

It turns out that the code tried to use macro HAVE___CXA_THREAD_ATEXIT_IMPL, but
not _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL which is defined in bits/c++config.h
(generated from autoconf scripts).

This patch adds the missing macro prefix.

Thanks,
Zifei

2014-07-29  Zifei Tong <zifeit...@gmail.com>
  * libsupc++/atexit_thread.cc: add _GLIBCXX_ macro prefix

---
 libstdc++-v3/libsupc++/atexit_thread.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libstdc++-v3/libsupc++/atexit_thread.cc 
b/libstdc++-v3/libsupc++/atexit_thread.cc
index db20200..dff08e9 100644
--- a/libstdc++-v3/libsupc++/atexit_thread.cc
+++ b/libstdc++-v3/libsupc++/atexit_thread.cc
@@ -26,7 +26,7 @@
 #include <new>
 #include "bits/gthr.h"
 
-#if HAVE___CXA_THREAD_ATEXIT_IMPL
+#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL
 
 extern "C" int __cxa_thread_atexit_impl (void (*func) (void *),
                                         void *arg, void *d);
@@ -38,7 +38,7 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *),
   return __cxa_thread_atexit_impl (dtor, obj, dso_handle);
 }
 
-#else /* HAVE___CXA_THREAD_ATEXIT_IMPL */
+#else /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
 
 namespace {
   // One element in a singly-linked stack of cleanups.
@@ -142,4 +142,4 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *), void 
*obj, void */*dso_ha
   return 0;
 }
 
-#endif /* HAVE___CXA_THREAD_ATEXIT_IMPL */
+#endif /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
-- 
2.0.3

Reply via email to