mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-04-26 14:16:32 +00:00
glib: Use GTHREAD preprocessor flag with old versions of glib
We switch the logic from DISABLE_GTHREAD_CHECK to ENABLE_GTHREAD_INIT to make the define clearer, and so that it is actually needed when using older versions of glib, not newer. Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
This commit is contained in:
parent
a0203691a4
commit
88bb31bfa7
|
@ -177,8 +177,8 @@ CSFLAGS="$DEBUG_FLAGS $WIN64DEFINES"
|
||||||
PKG_CHECK_MODULES(GLIB_2_31,
|
PKG_CHECK_MODULES(GLIB_2_31,
|
||||||
glib-2.0 >= 2.31,
|
glib-2.0 >= 2.31,
|
||||||
HAVE_GLIB_2_31_OR_HIGHER=yes, HAVE_GLIB_2_31_OR_HIGHER=no)
|
HAVE_GLIB_2_31_OR_HIGHER=yes, HAVE_GLIB_2_31_OR_HIGHER=no)
|
||||||
if test "x$HAVE_GLIB_2_31_OR_HIGHER" = "xyes" ; then
|
if test "x$HAVE_GLIB_2_31_OR_HIGHER" = "xno" ; then
|
||||||
CSFLAGS="$CSFLAGS -define:DISABLE_GTHREAD_CHECK"
|
CSFLAGS="$CSFLAGS -define:ENABLE_GTHREAD_INIT"
|
||||||
fi
|
fi
|
||||||
AC_SUBST(CSFLAGS)
|
AC_SUBST(CSFLAGS)
|
||||||
|
|
||||||
|
|
|
@ -28,18 +28,7 @@ namespace GLib
|
||||||
{
|
{
|
||||||
private Thread () {}
|
private Thread () {}
|
||||||
|
|
||||||
#if DISABLE_GTHREAD_CHECK
|
#if ENABLE_GTHREAD_INIT
|
||||||
public static void Init ()
|
|
||||||
{
|
|
||||||
// GLib automatically inits threads in 2.31 and above
|
|
||||||
// http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool Supported
|
|
||||||
{
|
|
||||||
get { return true; }
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
[DllImport ("libgthread-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport ("libgthread-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
static extern void g_thread_init (IntPtr i);
|
static extern void g_thread_init (IntPtr i);
|
||||||
|
|
||||||
|
@ -57,6 +46,17 @@ namespace GLib
|
||||||
return g_thread_get_initialized ();
|
return g_thread_get_initialized ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
public static void Init ()
|
||||||
|
{
|
||||||
|
// GLib automatically inits threads in 2.31 and above
|
||||||
|
// http://developer.gnome.org/glib/unstable/glib-Deprecated-Thread-APIs.html#g-thread-init
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool Supported
|
||||||
|
{
|
||||||
|
get { return true; }
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue