[vala] Add support for async signal handlers



commit bfcbc0b26c94f8c61f91bd41dc23290536cc9dd9
Author: Frederik 'playya' Sdun <Frederik Sdun googlemail com>
Date:   Fri Jan 28 15:43:34 2011 +0100

    Add support for async signal handlers
    
    Fixes bug 602594.

 codegen/valaccodedelegatemodule.vala |    4 ++++
 vala/valadelegate.vala               |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodedelegatemodule.vala b/codegen/valaccodedelegatemodule.vala
index fcf8bcc..cef9219 100644
--- a/codegen/valaccodedelegatemodule.vala
+++ b/codegen/valaccodedelegatemodule.vala
@@ -392,6 +392,10 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
 			last_pos = min_pos;
 		}
 
+		if (m.coroutine) {
+			ccall.add_argument (new CCodeConstant ("NULL"));
+			ccall.add_argument (new CCodeConstant ("NULL"));
+		}
 		var block = new CCodeBlock ();
 		if (m.return_type is VoidType || m.return_type.is_real_non_null_struct_type ()) {
 			block.add_statement (new CCodeExpressionStatement (ccall));
diff --git a/vala/valadelegate.vala b/vala/valadelegate.vala
index b56744b..ede77a3 100644
--- a/vala/valadelegate.vala
+++ b/vala/valadelegate.vala
@@ -157,7 +157,7 @@ public class Vala.Delegate : TypeSymbol {
 	 * @return  true if the specified method is compatible to this callback
 	 */
 	public bool matches_method (Method m, DataType dt) {
-		if (m.coroutine) {
+		if (m.coroutine && !(parent_symbol is Signal)) {
 			// async delegates are not yet supported
 			return false;
 		}



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