From: Bruno Haible Date: Wed, 6 May 2026 09:43:59 +0000 (+0200) Subject: pthread-h: Fix compilation error in C++ mode. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf47dbfb9082cc6a53764cf5a8d24ca224dbdda8;p=thirdparty%2Fgnulib.git pthread-h: Fix compilation error in C++ mode. Reported by Daiki Ueno. * lib/pthread.in.h: Disable the 'using GNULIB_NAMESPACE::pthread_*' directives for which the corresponding Gnulib module is not present. --- diff --git a/ChangeLog b/ChangeLog index 0bdf9d3745..d379b2d42a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2026-05-06 Bruno Haible + + pthread-h: Fix compilation error in C++ mode. + Reported by Daiki Ueno. + * lib/pthread.in.h: Disable the 'using GNULIB_NAMESPACE::pthread_*' + directives for which the corresponding Gnulib module is not present. + 2026-05-06 Bruno Haible regex: Fix compilation error with MSVC 2022. diff --git a/lib/pthread.in.h b/lib/pthread.in.h index 37deab8247..54eb83b015 100644 --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -1949,30 +1949,44 @@ _GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable - " #if defined __cplusplus && defined GNULIB_NAMESPACE && !@HAVE_PTHREAD_H@ && defined __MINGW32__ /* Provide the symbols required by mingw's . */ +# if @GNULIB_PTHREAD_THREAD@ using GNULIB_NAMESPACE::pthread_create; using GNULIB_NAMESPACE::pthread_self; using GNULIB_NAMESPACE::pthread_equal; using GNULIB_NAMESPACE::pthread_detach; using GNULIB_NAMESPACE::pthread_join; +# endif +# if @GNULIB_PTHREAD_ONCE@ using GNULIB_NAMESPACE::pthread_once; +# endif +# if @GNULIB_PTHREAD_MUTEX@ using GNULIB_NAMESPACE::pthread_mutex_init; using GNULIB_NAMESPACE::pthread_mutexattr_init; using GNULIB_NAMESPACE::pthread_mutexattr_settype; using GNULIB_NAMESPACE::pthread_mutexattr_destroy; using GNULIB_NAMESPACE::pthread_mutex_lock; using GNULIB_NAMESPACE::pthread_mutex_trylock; +# endif +# if @GNULIB_PTHREAD_MUTEX_TIMEDLOCK@ using GNULIB_NAMESPACE::pthread_mutex_timedlock; +# endif +# if @GNULIB_PTHREAD_MUTEX@ using GNULIB_NAMESPACE::pthread_mutex_unlock; using GNULIB_NAMESPACE::pthread_mutex_destroy; +# endif +# if @GNULIB_PTHREAD_COND@ using GNULIB_NAMESPACE::pthread_cond_wait; using GNULIB_NAMESPACE::pthread_cond_timedwait; using GNULIB_NAMESPACE::pthread_cond_signal; using GNULIB_NAMESPACE::pthread_cond_broadcast; using GNULIB_NAMESPACE::pthread_cond_destroy; +# endif +# if @GNULIB_PTHREAD_TSS@ using GNULIB_NAMESPACE::pthread_key_create; using GNULIB_NAMESPACE::pthread_setspecific; using GNULIB_NAMESPACE::pthread_getspecific; using GNULIB_NAMESPACE::pthread_key_delete; +# endif #endif