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
2 changed files with 14 additions and 14 deletions
|
@ -177,8 +177,8 @@ CSFLAGS="$DEBUG_FLAGS $WIN64DEFINES"
|
|||
PKG_CHECK_MODULES(GLIB_2_31,
|
||||
glib-2.0 >= 2.31,
|
||||
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
|
||||
CSFLAGS="$CSFLAGS -define:DISABLE_GTHREAD_CHECK"
|
||||
if test "x$HAVE_GLIB_2_31_OR_HIGHER" = "xno" ; then
|
||||
CSFLAGS="$CSFLAGS -define:ENABLE_GTHREAD_INIT"
|
||||
fi
|
||||
AC_SUBST(CSFLAGS)
|
||||
|
||||
|
|
|
@ -28,18 +28,7 @@ namespace GLib
|
|||
{
|
||||
private Thread () {}
|
||||
|
||||
#if DISABLE_GTHREAD_CHECK
|
||||
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
|
||||
#if ENABLE_GTHREAD_INIT
|
||||
[DllImport ("libgthread-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
static extern void g_thread_init (IntPtr i);
|
||||
|
||||
|
@ -57,6 +46,17 @@ namespace GLib
|
|||
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
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue