mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
Fix build when pthread_getname_np is not available
On Android _setname_ is always available but _getname_ is available only with API level >= 26. https://bugzilla.gnome.org/show_bug.cgi?id=795406
This commit is contained in:
@@ -2245,6 +2245,15 @@ AS_IF([ test x"$have_threads" = xposix], [
|
||||
AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_WITH_TID,1,
|
||||
[Have function pthread_setname_np(pthread_t, const char*)])],
|
||||
[AC_MSG_RESULT(no)])
|
||||
AC_MSG_CHECKING(for pthread_getname_np(pthread_t, name, len))
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[#include <pthread.h>],
|
||||
[[char name[16]; pthread_getname_np(pthread_self(), name, 16);]])],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PTHREAD_GETNAME_NP,1,
|
||||
[Have function pthread_getname_np(pthread_t, name, len)])],
|
||||
[AC_MSG_RESULT(no)])
|
||||
CPPFLAGS="$glib_save_CPPFLAGS"
|
||||
])
|
||||
|
||||
|
Reference in New Issue
Block a user