From 788bba368c2eaf8aa3fd2ca18d269395d6bc8afb Mon Sep 17 00:00:00 2001 From: Will Newton Date: Mon, 17 Mar 2014 10:16:53 +0000 Subject: Fix __PTHREAD_MUTEX_HAVE_ELISION -Wundef warning ChangeLog: 2014-03-17 Will Newton * nptl/sysdeps/pthread/pthread.h: Check __PTHREAD_MUTEX_HAVE_ELISION is defined before testing its value. --- nptl/sysdeps/pthread/pthread.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'nptl') 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 -- cgit 1.4.1