From a00bad39cb8288172c2b792d5f507e9fc7c2c5d1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 7 Jan 2019 15:19:44 +0100 Subject: gmmproc: _WRAP_ENUM and _WRAP_GERROR: Add gtype_func parameter The M4 macro _GET_TYPE_FUNC() does not generate correct function names for GDBus* enums. This fix makes it possible to specify the function name in the call to _WRAP_ENUM or _WRAP_GERROR. See issue #37 --- tools/m4/enum.m4 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tools/m4/enum.m4') diff --git a/tools/m4/enum.m4 b/tools/m4/enum.m4 index 9064e353..be07f5e0 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', `no_gtype', `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') +dnl $1 $2 $3 $4 $5 $6 $7 dnl m4_define(`_ENUM',`dnl _PUSH() @@ -71,7 +71,7 @@ inline __ENUM_CPPNAME__& operator^=(__ENUM_CPPNAME__& lhs, __ENUM_CPPNAME__ rhs) ')dnl endif Flags ifelse(`$7',,,`_DEPRECATE_IFDEF_END')`'dnl The expansion of _DEPRECATE_IFDEF_END ends with a newline -m4_ifelse($5,`NO_GTYPE',,`dnl else +m4_ifelse(`$5',`NO_GTYPE',,`dnl else __NAMESPACE_END__ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -96,7 +96,11 @@ ifelse(`$7',,,`_DEPRECATE_IFDEF_START')`'dnl // static GType Glib::Value<__NAMESPACE__::__ENUM_CPPNAME__>::value_type() { +m4_ifelse(`$5',,`dnl return _GET_TYPE_FUNC(__ENUM_CNAME__); +',`dnl + return `$5()'; +')dnl } ifelse(`$7',,,`_DEPRECATE_IFDEF_END')`'dnl -- cgit v1.2.1