]> Savannah Git Hosting - gnulib.git/commitdiff
pthread_sigmask: discount system version if a simple macro
authorPavel Fedin <p.fedin@samsung.com>
Mon, 1 Jun 2015 06:43:07 +0000 (09:43 +0300)
committerPádraig Brady <P@draigBrady.com>
Mon, 1 Jun 2015 11:29:27 +0000 (12:29 +0100)
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.

ChangeLog
m4/pthread_sigmask.m4

index 757871b3ba58779756f6afa10cea59cc8861f0b8..735f841158ee6a8e341f2f35a2396e3cc268fd50 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-06-01  Pavel Fedin  <p.fedin@samsung.com>
+
+       pthread_sigmask: discount system version if a simple macro (trivial)
+       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.
+
 2015-05-31  Pádraig Brady  <P@draigBrady.com>
 
        readlinkat: avoid OS X 10.10 trailing slash bug
index 5c17dfcd852aa3d4254f721740eb0f1f9d7ca7f2..25988566461fa14bbe64b59d2916b4d2ab75ca6e 100644 (file)
@@ -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,
@@ -39,6 +39,30 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
                [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
              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"