diff mbox

s3power.c, s4.c: add backward compatibility with older glib releases

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

Commit Message

Alberto Milone Aug. 11, 2014, 9:34 a.m. UTC
Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
---
 src/acpi/s3power/s3power.c | 5 +++++
 src/acpi/s4/s4.c           | 5 +++++
 2 files changed, 10 insertions(+)

Comments

Keng-Yu Lin Aug. 12, 2014, 6:07 a.m. UTC | #1
On Mon, Aug 11, 2014 at 5:34 PM, Alberto Milone
<alberto.milone@canonical.com> wrote:
> Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
> ---
>  src/acpi/s3power/s3power.c | 5 +++++
>  src/acpi/s4/s4.c           | 5 +++++
>  2 files changed, 10 insertions(+)
>
> diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
> index 275539c..c391fd9 100644
> --- a/src/acpi/s3power/s3power.c
> +++ b/src/acpi/s3power/s3power.c
> @@ -247,6 +247,11 @@ static int s3power_test(fwts_framework *fw)
>
>         int (*do_suspend)(fwts_pm_method_vars *, const int, int*, const char*);
>
> +#if !GLIB_CHECK_VERSION(2,35,0)
> +       /* This is for backward compatibility with old glib versions */
> +       g_type_init();
> +#endif
> +
>         fwts_settings = calloc(1, sizeof(fwts_pm_method_vars));
>         if (fwts_settings == NULL)
>                 return FWTS_OUT_OF_MEMORY;
> diff --git a/src/acpi/s4/s4.c b/src/acpi/s4/s4.c
> index 8400538..2ea76bb 100644
> --- a/src/acpi/s4/s4.c
> +++ b/src/acpi/s4/s4.c
> @@ -348,6 +348,11 @@ static int s4_test_multiple(fwts_framework *fw)
>         bool retried = false;
>         char tmp[32];
>
> +#if !GLIB_CHECK_VERSION(2,35,0)
> +       /* This is for backward compatibility with old glib versions */
> +       g_type_init();
> +#endif
> +
>          if (s4_multiple == 1)
>                  fwts_log_info(fw, "Defaulted to run 1 test, run --s4-multiple=N to run more S4 cycles\n");
>
> --
> 1.9.1
>
>

Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung Aug. 12, 2014, 2:43 p.m. UTC | #2
On 08/11/2014 05:34 PM, Alberto Milone wrote:
> Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
> ---
>  src/acpi/s3power/s3power.c | 5 +++++
>  src/acpi/s4/s4.c           | 5 +++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
> index 275539c..c391fd9 100644
> --- a/src/acpi/s3power/s3power.c
> +++ b/src/acpi/s3power/s3power.c
> @@ -247,6 +247,11 @@ static int s3power_test(fwts_framework *fw)
>  
>  	int (*do_suspend)(fwts_pm_method_vars *, const int, int*, const char*);
>  
> +#if !GLIB_CHECK_VERSION(2,35,0)
> +	/* This is for backward compatibility with old glib versions */
> +	g_type_init();
> +#endif
> +
>  	fwts_settings = calloc(1, sizeof(fwts_pm_method_vars));
>  	if (fwts_settings == NULL)
>  		return FWTS_OUT_OF_MEMORY;
> diff --git a/src/acpi/s4/s4.c b/src/acpi/s4/s4.c
> index 8400538..2ea76bb 100644
> --- a/src/acpi/s4/s4.c
> +++ b/src/acpi/s4/s4.c
> @@ -348,6 +348,11 @@ static int s4_test_multiple(fwts_framework *fw)
>  	bool retried = false;
>  	char tmp[32];
>  
> +#if !GLIB_CHECK_VERSION(2,35,0)
> +	/* This is for backward compatibility with old glib versions */
> +	g_type_init();
> +#endif
> +
>          if (s4_multiple == 1)
>                  fwts_log_info(fw, "Defaulted to run 1 test, run --s4-multiple=N to run more S4 cycles\n");
>  
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Kun Yang Aug. 14, 2014, 5:40 a.m. UTC | #3

diff mbox

Patch

diff --git a/src/acpi/s3power/s3power.c b/src/acpi/s3power/s3power.c
index 275539c..c391fd9 100644
--- a/src/acpi/s3power/s3power.c
+++ b/src/acpi/s3power/s3power.c
@@ -247,6 +247,11 @@  static int s3power_test(fwts_framework *fw)
 
 	int (*do_suspend)(fwts_pm_method_vars *, const int, int*, const char*);
 
+#if !GLIB_CHECK_VERSION(2,35,0)
+	/* This is for backward compatibility with old glib versions */
+	g_type_init();
+#endif
+
 	fwts_settings = calloc(1, sizeof(fwts_pm_method_vars));
 	if (fwts_settings == NULL)
 		return FWTS_OUT_OF_MEMORY;
diff --git a/src/acpi/s4/s4.c b/src/acpi/s4/s4.c
index 8400538..2ea76bb 100644
--- a/src/acpi/s4/s4.c
+++ b/src/acpi/s4/s4.c
@@ -348,6 +348,11 @@  static int s4_test_multiple(fwts_framework *fw)
 	bool retried = false;
 	char tmp[32];
 
+#if !GLIB_CHECK_VERSION(2,35,0)
+	/* This is for backward compatibility with old glib versions */
+	g_type_init();
+#endif
+
         if (s4_multiple == 1)
                 fwts_log_info(fw, "Defaulted to run 1 test, run --s4-multiple=N to run more S4 cycles\n");