diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 1293b037..02b8abb3 100644 --- a/configure.ac +++ b/configure.ac @@ -833,25 +833,25 @@ AS_IF([test "$THREADS" = posix], [AC_MSG_CHECKING(for pthread_setname_np) old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $CFLAGS_EXTRA -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], - [pthread_setname_np("thread-name")])], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +# define _GNU_SOURCE 1 +# include <pthread.h> + ], [pthread_setname_np("thread-name")])], [AC_MSG_RESULT([yes (w/o tid)]) AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID], [1], [Define to use 'pthread_setname_np(const char*)' function.])], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], - [pthread_setname_np(pthread_self(), "thread-name-%u", 0)])], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ +# define _GNU_SOURCE 1 +# include <pthread.h> + ], [pthread_setname_np(pthread_self(), "thread-name-%u", 0)])], [AC_MSG_RESULT([yes (with tid and arg)]) AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_WITH_TID_AND_ARG], [1], [Define to use 'pthread_setname_np(pthread_t, const char*, void *)' function.])], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ -# ifdef __CYGWIN__ -# define _GNU_SOURCE 1 -# elif defined(__linux__) || defined(__GLIBC__) || defined(__GNU__) -# define _GNU_SOURCE 1 -# endif -# include <pthread.h> - ], [pthread_setname_np(pthread_self(), "thread-name")])], +# define _GNU_SOURCE 1 +# include <pthread.h> + ], [pthread_setname_np(pthread_self(), "thread-name")])], [AC_MSG_RESULT([yes (with tid)]) AC_DEFINE([HAVE_PTHREAD_SETNAME_NP_WITH_TID], [1], [Define to use 'pthread_setname_np(pthread_t, const char*)' |