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 b4b2b13..37cb249 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