From ee4afc80607bbfcfbbf6daa8ec92195f14c44c7d Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sat, 21 Nov 2009 10:25:08 -0800 Subject: [PATCH] add block support --- cf/make-proto.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cf/make-proto.pl b/cf/make-proto.pl index 04733e128..02e407e15 100644 --- a/cf/make-proto.pl +++ b/cf/make-proto.pl @@ -253,8 +253,14 @@ $private_h_trailer = ""; foreach(sort keys %funcs){ if(/^(main)$/) { next } + if ($funcs{$_} =~ /\^/) { + $beginblock = "#ifdef __BLOCKS__\n"; + $endblock = "#endif /* __BLOCKS__ */\n"; + } else { + $beginblock = $endblock = ""; + } if(!defined($exported{$_}) && /$private_func_re/) { - $private_h .= $funcs{$_} . "\n\n"; + $private_h .= $beginblock . $funcs{$_} . "\n" . $endblock . "\n"; if($funcs{$_} =~ /__attribute__/) { $private_attribute_seen = 1; } @@ -267,7 +273,7 @@ foreach(sort keys %funcs){ $public_h .= "#ifndef HAVE_$fupper\n"; } } - $public_h .= $funcs{$_} . "\n"; + $public_h .= $beginblock . $funcs{$_} . "\n" . $endblock; if($funcs{$_} =~ /__attribute__/) { $public_attribute_seen = 1; }