]> Savannah Git Hosting - gnulib.git/commitdiff
pthread-spin: Fix errors in C++ mode.
authorBruno Haible <bruno@clisp.org>
Thu, 21 Nov 2019 10:44:05 +0000 (11:44 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 21 Nov 2019 10:44:05 +0000 (11:44 +0100)
* m4/pthread-spin.m4 (gl_PTHREAD_SPIN): Mark the pthread_spin_*
functions as nonexistent when <pthread.h> exists but does not define
the pthread_spinlock_t type.

ChangeLog
m4/pthread-spin.m4

index 4d99aca6a80c5959deea305ad292b411ca209278..23e8176022afd057066a3b0880275da167d3ee91 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-11-21  Bruno Haible  <bruno@clisp.org>
+
+       pthread-spin: Fix errors in C++ mode.
+       * m4/pthread-spin.m4 (gl_PTHREAD_SPIN): Mark the pthread_spin_*
+       functions as nonexistent when <pthread.h> exists but does not define
+       the pthread_spinlock_t type.
+
 2019-11-21  Bruno Haible  <bruno@clisp.org>
 
        pthread-mutex: Fix errors in C++ mode.
index 9352d5a53a476b8aa8d62b317b2a32bda6497bf6..c546e2f7b07605bfa948d91755696f854c339736 100644 (file)
@@ -1,4 +1,4 @@
-# pthread-spin.m4 serial 1
+# pthread-spin.m4 serial 2
 dnl Copyright (C) 2019 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,7 +19,7 @@ AC_DEFUN([gl_PTHREAD_SPIN],
     REPLACE_PTHREAD_SPIN_UNLOCK=1
     REPLACE_PTHREAD_SPIN_DESTROY=1
   else
-    if test $HAVE_PTHREAD_H = 0; then
+    if test $HAVE_PTHREAD_H = 0 || test $HAVE_PTHREAD_SPINLOCK_T = 0; then
       HAVE_PTHREAD_SPIN_INIT=0
       HAVE_PTHREAD_SPIN_LOCK=0
       HAVE_PTHREAD_SPIN_TRYLOCK=0