# ifndef GC_PTHREAD_CREATE_CONST
# define GC_PTHREAD_CREATE_CONST /* empty */
# endif
-# ifndef GC_PTHREAD_EXIT_ATTRIBUTE
+# ifndef GC_HAVE_PTHREAD_EXIT
+# define GC_HAVE_PTHREAD_EXIT
# define GC_PTHREAD_EXIT_ATTRIBUTE /* empty */
# endif
# endif
-# if !defined(GC_PTHREAD_EXIT_ATTRIBUTE) \
+# if !defined(GC_HAVE_PTHREAD_EXIT) \
&& !defined(PLATFORM_ANDROID) && !defined(__ANDROID__) \
&& (defined(GC_LINUX_THREADS) || defined(GC_SOLARIS_THREADS))
+# define GC_HAVE_PTHREAD_EXIT
/* Intercept pthread_exit on Linux and Solaris. */
# if defined(__GNUC__) /* since GCC v2.7 */
# define GC_PTHREAD_EXIT_ATTRIBUTE __attribute__((__noreturn__))
# endif
# endif
-# if (!defined(GC_PTHREAD_EXIT_ATTRIBUTE) || defined(__native_client__)) \
+# if (!defined(GC_HAVE_PTHREAD_EXIT) || defined(__native_client__)) \
&& !defined(GC_NO_PTHREAD_CANCEL)
/* Either there is no pthread_cancel() or no need to intercept it. */
# define GC_NO_PTHREAD_CANCEL
# ifndef GC_NO_PTHREAD_CANCEL
# undef pthread_cancel
# endif
-# ifdef GC_PTHREAD_EXIT_ATTRIBUTE
+# ifdef GC_HAVE_PTHREAD_EXIT
# undef pthread_exit
# endif
# undef pthread_join
# ifndef GC_NO_PTHREAD_CANCEL
# define pthread_cancel __pthread_cancel
# endif
-# ifdef GC_PTHREAD_EXIT_ATTRIBUTE
+# ifdef GC_HAVE_PTHREAD_EXIT
# define pthread_exit __pthread_exit
# endif
# endif
# ifndef GC_NO_PTHREAD_CANCEL
int REAL_FUNC(pthread_cancel)(pthread_t);
# endif
-# ifdef GC_PTHREAD_EXIT_ATTRIBUTE
+# ifdef GC_HAVE_PTHREAD_EXIT
void REAL_FUNC(pthread_exit)(void *) GC_PTHREAD_EXIT_ATTRIBUTE;
# endif
#else
typedef int (* GC_pthread_cancel_t)(pthread_t);
static GC_pthread_cancel_t REAL_FUNC(pthread_cancel);
# endif
-# ifdef GC_PTHREAD_EXIT_ATTRIBUTE
+# ifdef GC_HAVE_PTHREAD_EXIT
typedef void (* GC_pthread_exit_t)(void *) GC_PTHREAD_EXIT_ATTRIBUTE;
static GC_pthread_exit_t REAL_FUNC(pthread_exit);
# endif
}
# endif /* !GC_NO_PTHREAD_CANCEL */
-# ifdef GC_PTHREAD_EXIT_ATTRIBUTE
+# ifdef GC_HAVE_PTHREAD_EXIT
GC_API GC_PTHREAD_EXIT_ATTRIBUTE void GC_pthread_exit(void *retval)
{
pthread_exit(retval);
}
-# endif /* GC_PTHREAD_EXIT_ATTRIBUTE */
+# endif
#endif /* Linker-based interception. */
#ifdef GC_USE_DLOPEN_WRAP
REAL_FUNC(pthread_cancel) = (GC_pthread_cancel_t)
dlsym(dl_handle, "pthread_cancel");
# endif
-# ifdef GC_PTHREAD_EXIT_ATTRIBUTE
+# ifdef GC_HAVE_PTHREAD_EXIT
REAL_FUNC(pthread_exit) = (GC_pthread_exit_t)
dlsym(dl_handle, "pthread_exit");
# endif
GC_ASSERT(GC_getspecific(GC_thread_key) == &me->tlfs);
GC_destroy_thread_local(&(me->tlfs));
# endif
-# if defined(GC_PTHREAD_EXIT_ATTRIBUTE) || !defined(GC_NO_PTHREAD_CANCEL)
+# if defined(GC_HAVE_PTHREAD_EXIT) || !defined(GC_NO_PTHREAD_CANCEL)
/* Handle DISABLED_GC flag which is set by the */
/* intercepted pthread_cancel or pthread_exit. */
if ((me -> flags & DISABLED_GC) != 0) {
}
#endif /* !GC_NO_PTHREAD_CANCEL */
-#ifdef GC_PTHREAD_EXIT_ATTRIBUTE
+#ifdef GC_HAVE_PTHREAD_EXIT
GC_API GC_PTHREAD_EXIT_ATTRIBUTE void WRAP_FUNC(pthread_exit)(void *retval)
{
pthread_t self = pthread_self();
REAL_FUNC(pthread_exit)(retval);
}
-#endif /* GC_PTHREAD_EXIT_ATTRIBUTE */
+#endif /* GC_HAVE_PTHREAD_EXIT */
GC_INNER GC_bool GC_in_thread_creation = FALSE;
/* Protected by allocation lock. */