This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[PATCH] libstdc++: add _GLIBCXX_ macro prefix in atexit_thread.cc
- From: Zifei Tong <zifeitong at gmail dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Cc: Zifei Tong <zifeitong at gmail dot com>, Jason Merrill <jason at redhat dot com>, Siddhesh Poyarekar <siddhesh at redhat dot com>
- Date: Wed, 30 Jul 2014 22:42:36 +0800
- Subject: [PATCH] libstdc++: add _GLIBCXX_ macro prefix in atexit_thread.cc
- Authentication-results: sourceware.org; auth=none
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 <zifeitong@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