From 347e5ff7cae8f4d27e6a3b0f4ab7fc84854b29bb Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sun, 9 Sep 2012 12:57:38 +0400 Subject: [PATCH] Eliminate Clang warning for GC_pthread_exit attribute * include/gc_pthread_redirects.h (GC_PTHREAD_EXIT_DECLARED): Test and define new macro (only if GC_PTHREAD_EXIT_ATTRIBUTE) to prevent Clang warning "attribute declaration must precede definition" for GC_pthread_exit when this header included from extra/gc.c tail. --- include/gc_pthread_redirects.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/gc_pthread_redirects.h b/include/gc_pthread_redirects.h index b4b2b131..37cb249a 100644 --- a/include/gc_pthread_redirects.h +++ b/include/gc_pthread_redirects.h @@ -58,7 +58,8 @@ GC_API int GC_pthread_detach(pthread_t); GC_API int GC_pthread_cancel(pthread_t); #endif -#ifdef GC_PTHREAD_EXIT_ATTRIBUTE +#if defined(GC_PTHREAD_EXIT_ATTRIBUTE) && !defined(GC_PTHREAD_EXIT_DECLARED) +# define GC_PTHREAD_EXIT_DECLARED GC_API void GC_pthread_exit(void *) GC_PTHREAD_EXIT_ATTRIBUTE; #endif -- 2.49.0