about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWill Newton <will.newton@linaro.org>2014-03-17 10:16:53 +0000
committerWill Newton <will.newton@linaro.org>2014-03-17 16:05:22 +0000
commit788bba368c2eaf8aa3fd2ca18d269395d6bc8afb (patch)
treeee5e373caa7cd2ea57f61e00ea3f9907fc2f3ece
parentae42bbc55a9e05976269026ddabcfb917f6e922f (diff)
downloadglibc-788bba368c2eaf8aa3fd2ca18d269395d6bc8afb.tar.gz
glibc-788bba368c2eaf8aa3fd2ca18d269395d6bc8afb.tar.xz
glibc-788bba368c2eaf8aa3fd2ca18d269395d6bc8afb.zip
Fix __PTHREAD_MUTEX_HAVE_ELISION -Wundef warning
ChangeLog:

2014-03-17  Will Newton  <will.newton@linaro.org>

	* nptl/sysdeps/pthread/pthread.h: Check
	__PTHREAD_MUTEX_HAVE_ELISION is defined before testing
	its value.
-rw-r--r--ChangeLog6
-rw-r--r--nptl/sysdeps/pthread/pthread.h14
2 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index da6a230500..502008c809 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-03-17  Will Newton  <will.newton@linaro.org>
+
+	* nptl/sysdeps/pthread/pthread.h: Check
+	__PTHREAD_MUTEX_HAVE_ELISION is defined before testing
+	its value.
+
 2014-03-17  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
 	* libio/iofdopen.c (_IO_new_fdopen): Seek to end only if
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index 1e0c5dc937..142da639e4 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -83,12 +83,16 @@ enum
 
 
 /* Mutex initializers.  */
-#if __PTHREAD_MUTEX_HAVE_ELISION == 1 /* 64bit layout.  */
-#define __PTHREAD_SPINS 0, 0
-#elif __PTHREAD_MUTEX_HAVE_ELISION == 2 /* 32bit layout.  */
-#define __PTHREAD_SPINS { 0, 0 }
+#ifdef __PTHREAD_MUTEX_HAVE_ELISION
+# if __PTHREAD_MUTEX_HAVE_ELISION == 1 /* 64bit layout.  */
+#  define __PTHREAD_SPINS 0, 0
+# elif __PTHREAD_MUTEX_HAVE_ELISION == 2 /* 32bit layout.  */
+#  define __PTHREAD_SPINS { 0, 0 }
+# else
+#  error "Unknown value of __PTHREAD_MUTEX_HAVE_ELISION"
+# endif
 #else
-#define __PTHREAD_SPINS 0
+# define __PTHREAD_SPINS 0
 #endif
 
 #ifdef __PTHREAD_MUTEX_HAVE_PREV