[vala] codegen: Do not call g_type_init when targeting GLib >= 2.36



commit f1fbafdfdc91fadaa57d2e073fc29cc6804d6ae3
Author: JÃrg Billeter <j bitron ch>
Date:   Fri Oct 19 21:32:04 2012 +0200

    codegen: Do not call g_type_init when targeting GLib >= 2.36
    
    Fixes bug 686222.

 codegen/valaccodemethodmodule.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index d6b8cf4..12298b3 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -841,7 +841,9 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
 				ccode.add_expression (thread_init_call);
 			}
 
-			ccode.add_expression (new CCodeFunctionCall (new CCodeIdentifier ("g_type_init")));
+			if (!context.require_glib_version (2, 36)) {
+				ccode.add_expression (new CCodeFunctionCall (new CCodeIdentifier ("g_type_init")));
+			}
 
 			var main_call = new CCodeFunctionCall (new CCodeIdentifier (function.name));
 			if (m.get_parameters ().size == 1) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]