[PATCH] glib: guard invocations of g_type_init()
Aleksander Morgado
aleksander at aleksander.es
Fri Feb 3 08:48:53 UTC 2017
On 03/02/17 01:46, Ben Chan wrote:
> g_type_init() has been deprecated (and also marked with the attribute
> 'deprecated') since glib 2.36 as the type system is automatically
> initialized. Since the minimum version of glib required by libmbim is
> 2.32, calling g_type_init() should be guarded with the
> GLIB_CHECK_VERSION macro. When libmbim later requires at least glib
> 2.36, we can completely remove all invocations of g_type_init() from the
> code.
Thanks, pushed to git master, mbim-1-14 and mbim-1-12
> ---
> src/mbim-proxy/mbim-proxy.c | 2 ++
> src/mbimcli/mbimcli.c | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/src/mbim-proxy/mbim-proxy.c b/src/mbim-proxy/mbim-proxy.c
> index f29303f..2e8eeb9 100644
> --- a/src/mbim-proxy/mbim-proxy.c
> +++ b/src/mbim-proxy/mbim-proxy.c
> @@ -196,7 +196,9 @@ int main (int argc, char **argv)
>
> setlocale (LC_ALL, "");
>
> +#if !GLIB_CHECK_VERSION (2, 36, 0)
> g_type_init ();
> +#endif
>
> /* Setup option context, process it and destroy it */
> context = g_option_context_new ("- Proxy for MBIM devices");
> diff --git a/src/mbimcli/mbimcli.c b/src/mbimcli/mbimcli.c
> index 9906693..a265895 100644
> --- a/src/mbimcli/mbimcli.c
> +++ b/src/mbimcli/mbimcli.c
> @@ -372,7 +372,9 @@ int main (int argc, char **argv)
>
> setlocale (LC_ALL, "");
>
> +#if !GLIB_CHECK_VERSION (2, 36, 0)
> g_type_init ();
> +#endif
>
> /* Setup option context, process it and destroy it */
> context = g_option_context_new ("- Control MBIM devices");
>
--
Aleksander
https://aleksander.es
More information about the libmbim-devel
mailing list