summaryrefslogtreecommitdiff
path: root/recipes/glib/0011-glib-gthread-posix-Use-the-config.h-macros-to-detect.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/glib/0011-glib-gthread-posix-Use-the-config.h-macros-to-detect.patch')
-rw-r--r--recipes/glib/0011-glib-gthread-posix-Use-the-config.h-macros-to-detect.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/recipes/glib/0011-glib-gthread-posix-Use-the-config.h-macros-to-detect.patch b/recipes/glib/0011-glib-gthread-posix-Use-the-config.h-macros-to-detect.patch
new file mode 100644
index 00000000..24c5850c
--- /dev/null
+++ b/recipes/glib/0011-glib-gthread-posix-Use-the-config.h-macros-to-detect.patch
@@ -0,0 +1,99 @@
+From 80d8f886ee86963defd816f4aae5c4df697dee14 Mon Sep 17 00:00:00 2001
+From: "L. E. Segovia" <amy@centricular.com>
+Date: Mon, 1 Apr 2024 23:57:46 -0300
+Subject: [PATCH 11/12] glib/gthread-posix: Use the config.h macros to detect
+ futex support
+
+(cherry picked from commit 049c8e70c8f759d36bcf70f773e2e748f0f77738)
+---
+ glib/gthread-posix.c | 10 +++++-----
+ glib/gthreadprivate.h | 10 +++++-----
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/glib/gthread-posix.c b/glib/gthread-posix.c
+index cafbc9d54..08a8acf6a 100644
+--- a/glib/gthread-posix.c
++++ b/glib/gthread-posix.c
+@@ -1653,7 +1653,7 @@ g_cond_wait_until (GCond *cond,
+ sampled = cond->i[0];
+ g_mutex_unlock (mutex);
+
+-#ifdef __NR_futex_time64
++#if defined(HAVE_FUTEX_TIME64)
+ #if defined(__BIONIC__)
+ if (__builtin_available (android 30, *)) {
+ #else
+@@ -1674,9 +1674,9 @@ g_cond_wait_until (GCond *cond,
+ * normal `futex` syscall. This can happen if newer kernel headers are
+ * used than the kernel that is actually running.
+ */
+-# ifdef __NR_futex
++# if defined(HAVE_FUTEX)
+ if (res >= 0 || errno != ENOSYS)
+-# endif /* defined(__NR_futex) */
++# endif /* defined(HAVE_FUTEX) */
+ {
+ success = (res < 0 && errno == ETIMEDOUT) ? FALSE : TRUE;
+ g_mutex_lock (mutex);
+@@ -1686,7 +1686,7 @@ g_cond_wait_until (GCond *cond,
+ }
+ #endif
+
+-#ifdef __NR_futex
++#if defined(HAVE_FUTEX)
+ {
+ struct
+ {
+@@ -1707,7 +1707,7 @@ g_cond_wait_until (GCond *cond,
+
+ return success;
+ }
+-#endif /* defined(__NR_futex) */
++#endif /* defined(HAVE_FUTEX) */
+
+ /* We can't end up here because of the checks above */
+ g_assert_not_reached ();
+diff --git a/glib/gthreadprivate.h b/glib/gthreadprivate.h
+index 94a77fd33..a3a89e72e 100644
+--- a/glib/gthreadprivate.h
++++ b/glib/gthreadprivate.h
+@@ -66,7 +66,7 @@ struct _GRealThread
+ * This must not be called with a timeout parameter as that differs
+ * in size between the two syscall variants!
+ */
+-#if defined(__NR_futex) && defined(__NR_futex_time64)
++#if defined(HAVE_FUTEX) && defined(HAVE_FUTEX_TIME64)
+ #if defined(__BIONIC__)
+ #define g_futex_simple(uaddr, futex_op, ...) \
+ G_STMT_START \
+@@ -101,23 +101,23 @@ struct _GRealThread
+ } \
+ G_STMT_END
+ #endif /* defined(__BIONIC__) */
+-#elif defined(__NR_futex_time64)
++#elif defined(HAVE_FUTEX_TIME64)
+ #define g_futex_simple(uaddr, futex_op, ...) \
+ G_STMT_START \
+ { \
+ syscall (__NR_futex_time64, uaddr, (gsize) futex_op, __VA_ARGS__); \
+ } \
+ G_STMT_END
+-#elif defined(__NR_futex)
++#elif defined(HAVE_FUTEX)
+ #define g_futex_simple(uaddr, futex_op, ...) \
+ G_STMT_START \
+ { \
+ syscall (__NR_futex, uaddr, (gsize) futex_op, __VA_ARGS__); \
+ } \
+ G_STMT_END
+-#else /* !defined(__NR_futex) && !defined(__NR_futex_time64) */
++#else /* !defined(HAVE_FUTEX) && !defined(HAVE_FUTEX_TIME64) */
+ #error "Neither __NR_futex nor __NR_futex_time64 are available"
+-#endif /* defined(__NR_futex) && defined(__NR_futex_time64) */
++#endif /* defined(HAVE_FUTEX) && defined(HAVE_FUTEX_TIME64) */
+
+ #endif
+
+--
+2.44.0.windows.1
+