diff options
author | Pavel Fedin <p.fedin@samsung.com> | 2015-06-01 09:43:07 +0300 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2015-06-01 12:29:27 +0100 |
commit | f39477dba778e99392948dd3dd19ec0d46aee932 (patch) | |
tree | b9b5ae58758c807a8be936e0b7fb244d4a1d7e3b /m4 | |
parent | 8c9cfa07e6eb6a3365a516c90568fc6c5f3fcd34 (diff) | |
download | gnulib-f39477dba778e99392948dd3dd19ec0d46aee932.tar.gz |
pthread_sigmask: discount system version if a simple macro
MinGW64 has: #define pthread_sigmask(H, S1, S2) 0
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Call the
function to ensure it's available.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/pthread_sigmask.m4 | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4 index 5c17dfcd85..2598856646 100644 --- a/m4/pthread_sigmask.m4 +++ b/m4/pthread_sigmask.m4 @@ -1,4 +1,4 @@ -# pthread_sigmask.m4 serial 15 +# pthread_sigmask.m4 serial 16 dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -40,6 +40,30 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK], LIBS="$gl_save_LIBS" ]) if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then + AC_CACHE_CHECK([whether pthread_sigmask is only a macro], + [gl_cv_func_pthread_sigmask_is_macro], + [gl_save_LIBS="$LIBS" + LIBS="$LIBS $LIBMULTITHREAD" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include <pthread.h> + #include <signal.h> + #undef pthread_sigmask + ]], + [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);]]) + ], + [gl_cv_func_pthread_sigmask_is_macro=no], + [gl_cv_func_pthread_sigmask_is_macro=yes]) + LIBS="$gl_save_LIBS" + ]) + if test $gl_cv_func_pthread_sigmask_is_macro = yes; then + dnl On MinGW pthread_sigmask is just a macro which always returns 0. + dnl It does not exist as a real function, which is required by POSIX. + REPLACE_PTHREAD_SIGMASK=1 + gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no + fi + fi + if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then dnl pthread_sigmask is available with -pthread or -lpthread. LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD" else |