]> granicus.if.org Git - gc/commitdiff
Eliminate Clang warning for GC_pthread_exit attribute
authorIvan Maidanski <ivmai@mail.ru>
Sun, 9 Sep 2012 08:57:38 +0000 (12:57 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 9 Sep 2012 09:00:49 +0000 (13:00 +0400)
* 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

index b4b2b1312d52ec8c578fea44dc5f2befb4636d06..37cb249ac04acb52f9b9f6c47e72454051069aa3 100644 (file)
@@ -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