diff mbox

s3.c: add backward compatibility with older glib releases

Message ID 1407147645-24804-1-git-send-email-alberto.milone@canonical.com
State Accepted
Headers show

Commit Message

Alberto Milone Aug. 4, 2014, 10:20 a.m. UTC
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
---
 src/acpi/s3/s3.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Alberto Milone Aug. 4, 2014, 10:27 a.m. UTC | #1
On 04/08/14 12:20, Alberto Milone wrote:
> Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
> ---
>  src/acpi/s3/s3.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index adcd188..c04e11e 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -772,6 +772,11 @@ static int s3_test_multiple(fwts_framework *fw)
>  	int awake_delay = s3_min_delay * 1000;
>  	int delta = (int)(s3_delay_delta * 1000.0);
>  
> +#if !GLIB_CHECK_VERSION(2,35,0)
> +	/* This is for backward compatibility with old glib versions */
> +	g_type_init();
> +#endif
> +
>  	if (s3_multiple == 1)
>  		fwts_log_info(fw, "Defaulted to 1 test, use --s3-multiple=N to run more S3 cycles\n");
>  
> 

This is something we should include in the next minor release, so that
the old glib in Precise doesn't complain about the missing g_type_init().
Keng-Yu Lin Aug. 4, 2014, 2:20 p.m. UTC | #2
On Mon, Aug 4, 2014 at 6:20 PM, Alberto Milone
<alberto.milone@canonical.com> wrote:
> Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
> ---
>  src/acpi/s3/s3.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index adcd188..c04e11e 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -772,6 +772,11 @@ static int s3_test_multiple(fwts_framework *fw)
>         int awake_delay = s3_min_delay * 1000;
>         int delta = (int)(s3_delay_delta * 1000.0);
>
> +#if !GLIB_CHECK_VERSION(2,35,0)
> +       /* This is for backward compatibility with old glib versions */
> +       g_type_init();
> +#endif
> +
>         if (s3_multiple == 1)
>                 fwts_log_info(fw, "Defaulted to 1 test, use --s3-multiple=N to run more S3 cycles\n");
>
> --
> 1.9.1
>
>

Thanks Alberto.

Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung Aug. 6, 2014, 6:15 a.m. UTC | #3
On 08/04/2014 06:20 PM, Alberto Milone wrote:
> Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
> ---
>   src/acpi/s3/s3.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index adcd188..c04e11e 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -772,6 +772,11 @@ static int s3_test_multiple(fwts_framework *fw)
>   	int awake_delay = s3_min_delay * 1000;
>   	int delta = (int)(s3_delay_delta * 1000.0);
>
> +#if !GLIB_CHECK_VERSION(2,35,0)
> +	/* This is for backward compatibility with old glib versions */
> +	g_type_init();
> +#endif
> +
>   	if (s3_multiple == 1)
>   		fwts_log_info(fw, "Defaulted to 1 test, use --s3-multiple=N to run more S3 cycles\n");
>
>

Acked-by: Alex Hung <alex.hung@canonical.com>
diff mbox

Patch

diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
index adcd188..c04e11e 100644
--- a/src/acpi/s3/s3.c
+++ b/src/acpi/s3/s3.c
@@ -772,6 +772,11 @@  static int s3_test_multiple(fwts_framework *fw)
 	int awake_delay = s3_min_delay * 1000;
 	int delta = (int)(s3_delay_delta * 1000.0);
 
+#if !GLIB_CHECK_VERSION(2,35,0)
+	/* This is for backward compatibility with old glib versions */
+	g_type_init();
+#endif
+
 	if (s3_multiple == 1)
 		fwts_log_info(fw, "Defaulted to 1 test, use --s3-multiple=N to run more S3 cycles\n");