[glibmm/gmmproc-refactor] Fix ifdefing GErrors in wrap_init.cc.



commit 35c9f2ee85a8bf4f03220397eb4494a73214c9d9
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Sun Jul 22 17:04:52 2012 +0200

    Fix ifdefing GErrors in wrap_init.cc.

 tools/pm/Common/Gmmproc.pm         |    9 +++++----
 tools/pm/Common/WrapInit/GError.pm |    6 +++---
 tools/pm/Common/WrapParser.pm      |    6 +++---
 3 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/tools/pm/Common/Gmmproc.pm b/tools/pm/Common/Gmmproc.pm
index 4344ac6..6636042 100644
--- a/tools/pm/Common/Gmmproc.pm
+++ b/tools/pm/Common/Gmmproc.pm
@@ -280,14 +280,15 @@ sub _generate_wrap_init
           {
             my $include_entry = $total->{$include};
 
-            foreach my $another_pair ([0, $deprecated], [1, $cpp_condition])
+            foreach my $another_tuple ([0, $deprecated, 0], [1, $cpp_condition, undef])
             {
-              my $index = $another_pair->[0];
-              my $trait = $another_pair->[1];
+              my $index = $another_tuple->[0];
+              my $trait = $another_tuple->[1];
+              my $default_value = $another_tuple->[2];
 
               if ($include_entry->[$index] and not $trait)
               {
-                $include_entry->[$index] = 0;
+                $include_entry->[$index] = $default_value;
               }
             }
           }
diff --git a/tools/pm/Common/WrapInit/GError.pm b/tools/pm/Common/WrapInit/GError.pm
index dba07eb..7216d5b 100644
--- a/tools/pm/Common/WrapInit/GError.pm
+++ b/tools/pm/Common/WrapInit/GError.pm
@@ -36,13 +36,13 @@ sub _get_line
 
 sub new
 {
-  my ($type, $extra_includes, $c_includes, $cxx_includes, $deprecated, $not_for_windows, $mm_module, $cxx_type, $error_domain) = @_;
+  my ($type, $extra_includes, $c_includes, $cxx_includes, $deprecated, $cpp_condition, $mm_module, $cxx_type, $error_domain) = @_;
   my $class = (ref $type or $type or 'Common::WrapInit::GError');
-  my $self = $class->SUPER::new ($extra_includes, $c_includes, $cxx_includes, $deprecated, $not_for_windows, $mm_module);
+  my $self = $class->SUPER::new ($extra_includes, $c_includes, $cxx_includes, $deprecated, $cpp_condition, $mm_module);
 
   $self->{'cxx_type'} = $cxx_type;
   $self->{'error_domain'} = $error_domain;
-  return bless $self, $class;
+  return bless ($self, $class);
 }
 
 1; # indicate proper module load.
diff --git a/tools/pm/Common/WrapParser.pm b/tools/pm/Common/WrapParser.pm
index bebf3b8..4d07572 100644
--- a/tools/pm/Common/WrapParser.pm
+++ b/tools/pm/Common/WrapParser.pm
@@ -1471,7 +1471,7 @@ sub _on_wrap_gerror ($)
 # TODO: Add deprecated option to _WRAP_GERROR
   my $deprecated = 0;
 # TODO: Add "C preprocessor condition" option to _WRAP_GERROR
-  my $cpp_condition = 0;
+  my $cpp_condition = undef;
 # TODO: Add "Extra include" option to _WRAP_GERROR
   my $extra_includes = [];
   my $complete_cxx_type = Common::Output::Shared::get_complete_cxx_type ($self);
@@ -1481,8 +1481,8 @@ sub _on_wrap_gerror ($)
                                                        $deprecated,
                                                        $cpp_condition,
                                                        $self->get_mm_module (),
-                                                       $gir_domain,
-                                                       $complete_cxx_type);
+                                                       $complete_cxx_type,
+                                                       $gir_domain);
 
   $self->add_wrap_init_entry ($wrap_init_entry);
 }



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