From fe0be818924aead183c8240e2b4f245ae122b17a Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sun, 10 Aug 2014 18:02:38 +0200 Subject: [PATCH] build: Require GLib 2.32 or above GLib 2.32 has been released in March 2012, so we can now require it a build and run time. This allows us to remove GLib 2.31 conditionals, mark the Thread.Init as obsolete, and remove all references to libgthread. Please note that the API exposed in glib and gio is still from 2.28, but we will have some API additions in the future. First example is the next commit, which brings GBytes, an addition in GLib 2.32. --- configure.ac | 9 +-------- gio/gio-sharp.dll.config.in | 1 - glib/GType.cs | 3 --- glib/Thread.cs | 23 +---------------------- glib/glib-sharp.dll.config.in | 1 - msi/unmanaged/unmanaged.wxs | 3 --- 6 files changed, 2 insertions(+), 38 deletions(-) diff --git a/configure.ac b/configure.ac index 34f5eb04d..bd884217d 100644 --- a/configure.ac +++ b/configure.ac @@ -180,7 +180,7 @@ AC_SUBST(GENERATED_SOURCES_OPTION) AC_SUBST(ASSEMBLYINFO) GTK_REQUIRED_VERSION=3.0.0 -GLIB_REQUIRED_VERSION=2.28.0 +GLIB_REQUIRED_VERSION=2.32.0 PKG_CHECK_MODULES(GLIB, gobject-2.0 >= $GLIB_REQUIRED_VERSION) AC_SUBST(GLIB_CFLAGS) @@ -193,13 +193,6 @@ AC_SUBST(GIO_LIBS) CSFLAGS="$CSFLAGS $DEBUG_FLAGS $WIN64DEFINES" AC_SUBST(CSFLAGS) -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" = "xno" ; then - CSFLAGS="$CSFLAGS -define:ENABLE_GTHREAD_INIT" -fi - PKG_CHECK_MODULES(PANGO, pango) AC_SUBST(PANGO_CFLAGS) AC_SUBST(PANGO_LIBS) diff --git a/gio/gio-sharp.dll.config.in b/gio/gio-sharp.dll.config.in index 6dc0e6865..291df9db8 100644 --- a/gio/gio-sharp.dll.config.in +++ b/gio/gio-sharp.dll.config.in @@ -2,5 +2,4 @@ - diff --git a/glib/GType.cs b/glib/GType.cs index 5dfd312e6..7f63e2bae 100644 --- a/glib/GType.cs +++ b/glib/GType.cs @@ -110,9 +110,6 @@ namespace GLib { static GType () { - if (!GLib.Thread.Supported) - GLib.Thread.Init (); - g_type_init (); Register (GType.Char, typeof (sbyte)); diff --git a/glib/Thread.cs b/glib/Thread.cs index bded5eaa2..e51eb6b98 100644 --- a/glib/Thread.cs +++ b/glib/Thread.cs @@ -27,28 +27,8 @@ namespace GLib public class Thread { private Thread () {} - -#if ENABLE_GTHREAD_INIT - const string GThreadNativeLib = "libgthread-2.0-0.dll"; - [DllImport (GThreadNativeLib, CallingConvention = CallingConvention.Cdecl)] - static extern void g_thread_init (IntPtr i); - - public static void Init () - { - g_thread_init (IntPtr.Zero); - } - - [DllImport (GThreadNativeLib, CallingConvention = CallingConvention.Cdecl)] - static extern bool g_thread_get_initialized (); - - public static bool Supported - { - get { - return g_thread_get_initialized (); - } - } -#else + [Obsolete ("This is no longer needed, GLib automatically initializes threads")] public static void Init () { // GLib automatically inits threads in 2.31 and above @@ -59,7 +39,6 @@ namespace GLib { get { return true; } } -#endif } } diff --git a/glib/glib-sharp.dll.config.in b/glib/glib-sharp.dll.config.in index 5a5e136fe..03031d676 100644 --- a/glib/glib-sharp.dll.config.in +++ b/glib/glib-sharp.dll.config.in @@ -1,5 +1,4 @@ - diff --git a/msi/unmanaged/unmanaged.wxs b/msi/unmanaged/unmanaged.wxs index ad36df126..99a64c3a4 100644 --- a/msi/unmanaged/unmanaged.wxs +++ b/msi/unmanaged/unmanaged.wxs @@ -1362,9 +1362,6 @@ - - -