From 88251e63bb4fa7814c22ded1b068327abc64e1f6 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 15 Jan 2024 12:39:36 +0000 Subject: [PATCH] gir: Hide pthread types in deprecated GThread structures We only care about the introspection data for documentation purposes; the GStaticMutex and GStaticRecMutex types are long since deprecated, and they cannot be used from language bindings anyway, so their size is immaterial. Fixes: #3222 --- glib/deprecated/gthread.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/glib/deprecated/gthread.h b/glib/deprecated/gthread.h index a18a730d6..4988e0047 100644 --- a/glib/deprecated/gthread.h +++ b/glib/deprecated/gthread.h @@ -135,10 +135,12 @@ void g_thread_foreach (GFunc thread_func, typedef struct { GMutex *mutex; -#ifndef G_OS_WIN32 +#ifndef __GI_SCANNER__ +# ifndef G_OS_WIN32 /* only for ABI compatibility reasons */ pthread_mutex_t unused; -#endif +# endif /* !G_OS_WIN32 */ +#endif /* !__GI_SCANNER__ */ } GStaticMutex GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GMutex); #define g_static_mutex_lock(mutex) \ @@ -162,15 +164,17 @@ struct _GStaticRecMutex GStaticMutex mutex; guint depth; +#ifndef __GI_SCANNER__ /* ABI compat only */ union { -#ifdef G_OS_WIN32 +# ifdef G_OS_WIN32 void *owner; -#else +# else pthread_t owner; -#endif +# endif /* !G_OS_WIN32 */ gdouble dummy; } unused; +#endif /* !__GI_SCANNER__ */ } GLIB_DEPRECATED_TYPE_IN_2_32_FOR(GRecMutex); #define G_STATIC_REC_MUTEX_INIT { G_STATIC_MUTEX_INIT, 0, { 0 } } GLIB_DEPRECATED_MACRO_IN_2_32_FOR(g_rec_mutex_init)