changeset 17410:f168b4090f6f

thread: port --enable-gcc-warnings to clang * lib/glthread/thread.h [__clang__ && USE_POSIX_THREADS_WEAK]: Include <signal.h>, to pacify a warning about pthread_sigmask.
author Paul Eggert <eggert@cs.ucla.edu>
date Wed, 15 May 2013 15:54:44 -0700
parents 26a04e61f560
children 408bf14c6fc4
files ChangeLog lib/glthread/thread.h
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2013-05-15  Paul Eggert  <eggert@cs.ucla.edu>
 
+	thread: port --enable-gcc-warnings to clang
+	* lib/glthread/thread.h [__clang__ && USE_POSIX_THREADS_WEAK]:
+	Include <signal.h>, to pacify a warning about pthread_sigmask.
+
 	stdio: use __REDIRECT for fwrite, fwrite_unlocked
 	* lib/stdio.in.h (fwrite):
 	When working around bug 11959, use __REDIRECT rather than '#define
--- a/lib/glthread/thread.h
+++ b/lib/glthread/thread.h
@@ -120,7 +120,13 @@
    address of a function in libpthread that we don't use.  */
 
 #  pragma weak pthread_create
+
+#  ifdef __clang__
+  /* Without this, clang complains that pthread_sigmask is never declared.  */
+#   include <signal.h>
+#  endif
 #  pragma weak pthread_sigmask
+
 #  pragma weak pthread_join
 #  ifndef pthread_self
 #   pragma weak pthread_self