[glibmm/export-more-symbols-2-64: 1/3] tools/[gerror|enum].m4: Make template<> classes exportable



commit 8278af9a41aa0b8bdeedcd451031538cb5f1510e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Mar 30 18:45:36 2020 +0800

    tools/[gerror|enum].m4: Make template<> classes exportable
    
    Allow to apply the decl_prefix argument onto the template<> classes that
    we generate for the _WRAP_GERROR and _WRAP_ENUM directives in the
    various *.hg files, if specified.

 tools/m4/enum.m4       |  6 +++---
 tools/pm/Output.pm     | 13 +++++++------
 tools/pm/WrapParser.pm |  4 ++--
 3 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/tools/m4/enum.m4 b/tools/m4/enum.m4
index be07f5e0..a2d5ecd3 100644
--- a/tools/m4/enum.m4
+++ b/tools/m4/enum.m4
@@ -1,6 +1,6 @@
 dnl
-dnl _ENUM(cpp_type, c_type, value_suffix, `element_list', `gtype_func', `optional_refdoc_comment', 
'deprecated')
-dnl          $1       $2         $3             $4             $5              $6                        $7
+dnl _ENUM(cpp_type, c_type, value_suffix, `element_list', `gtype_func', `optional_refdoc_comment', 
'deprecated', `decl_prefix')
+dnl          $1       $2         $3             $4             $5              $6                        $7  
          $8
 dnl
 m4_define(`_ENUM',`dnl
 _PUSH()
@@ -80,7 +80,7 @@ namespace Glib
 
 ifelse(`$7',,,`_DEPRECATE_IFDEF_START')`'dnl
 template <>
-class Value<__NAMESPACE__::__ENUM_CPPNAME__> : public __ENUM_VALUE_BASE__
+class $8 Value<__NAMESPACE__::__ENUM_CPPNAME__> : public __ENUM_VALUE_BASE__
 {
 public:
   static GType value_type() G_GNUC_CONST;
diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm
index 63dcd697..940a177c 100644
--- a/tools/pm/Output.pm
+++ b/tools/pm/Output.pm
@@ -685,12 +685,12 @@ sub output_wrap_sig_decl($$$$$$$$$$$$$$)
 
 # void output_wrap_enum($filename, $line_num, $cpp_type, $c_type,
 #   $comment, $ref_subst_in, $ref_subst_out, $gtype_func,
-#   $deprecated, $deprecation_docs, $newin)
-sub output_wrap_enum($$$$$$$$$$$$)
+#   $deprecated, $deprecation_docs, $newin, $decl_prefix)
+sub output_wrap_enum($$$$$$$$$$$$$)
 {
   my ($self, $filename, $line_num, $cpp_type, $c_type,
     $comment, $ref_subst_in, $ref_subst_out, $gtype_func,
-    $deprecated, $deprecation_docs, $newin) = @_;
+    $deprecated, $deprecation_docs, $newin, $decl_prefix) = @_;
 
   my $objEnum = GtkDefs::lookup_enum($c_type);
   if(!$objEnum)
@@ -720,14 +720,15 @@ sub output_wrap_enum($$$$$$$$$$$$)
   # Merge the passed in comment to the existing enum documentation.
   $comment .= "\n * " . $enum_docs if $enum_docs ne "";
 
-  my $str = sprintf("_ENUM(%s,%s,%s,\`%s\',\`%s\',\`%s\',\`%s\')dnl\n",
+  my $str = sprintf("_ENUM(%s,%s,%s,\`%s\',\`%s\',\`%s\',\`%s\',\`%s\')dnl\n",
     $cpp_type,
     $c_type,
     $value_suffix,
     $elements,
     $gtype_func,
     $comment,
-    $deprecated
+    $deprecated,
+    $decl_prefix
   );
 
   $self->append($str);
@@ -736,7 +737,7 @@ sub output_wrap_enum($$$$$$$$$$$$)
 sub output_wrap_enum_docs_only($$$$$$$$$$$)
 {
   my ($self, $filename, $line_num, $module_canonical, $cpp_type, $c_type,
-    $comment, $ref_subst_in, $ref_subst_out, $deprecation_docs, $newin) = @_;
+    $comment, $ref_subst_in, $ref_subst_out, $deprecation_docs, $newin, $decl_prefix) = @_;
 
   # Get the existing enum description from the parsed docs.
   my $enum_docs = DocsParser::lookup_enum_documentation("$c_type", "$cpp_type",
diff --git a/tools/pm/WrapParser.pm b/tools/pm/WrapParser.pm
index 2e2121a8..8ed038ab 100644
--- a/tools/pm/WrapParser.pm
+++ b/tools/pm/WrapParser.pm
@@ -1505,12 +1505,12 @@ sub on_wrap_enum($)
 
   # get the arguments
   my ($cpp_type, $c_type, undef, $ref_subst_in, $ref_subst_out, $gtype_func,
-    $argDeprecated, $deprecation_docs, $newin) = $self->on_wrap_any_enum(0);
+    $argDeprecated, $deprecation_docs, $newin, $decl_prefix) = $self->on_wrap_any_enum(0);
 
   $$self{objOutputter}->output_wrap_enum(
     $$self{filename}, $$self{line_num}, $cpp_type, $c_type,
     $comment, $ref_subst_in, $ref_subst_out, $gtype_func,
-    $argDeprecated, $deprecation_docs, $newin);
+    $argDeprecated, $deprecation_docs, $newin, $decl_prefix);
 }
 
 sub on_wrap_enum_docs_only($)


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