[gtkmm] tools: _WRAP_CHILD_PROPERTY: Check the data type
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] tools: _WRAP_CHILD_PROPERTY: Check the data type
- Date: Thu, 31 Jan 2019 12:49:04 +0000 (UTC)
commit c30549e52f7723eae6a2d248ecd21623249b3d08
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Thu Jan 31 13:46:53 2019 +0100
tools: _WRAP_CHILD_PROPERTY: Check the data type
tools/m4/child_property.m4: _WRAP_CHILD_PROPERTY generates a static_assert()
that checks if the data type is acceptible. The generation of the
static_assert() can be suppressed with the new parameter no_type_check.
For this to work, the code must be generated with a glibmm/gmmproc version
from 2019-01-31 or newer.
tools/m4/child_property.m4 | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/tools/m4/child_property.m4 b/tools/m4/child_property.m4
index 6add3468..5a1bf0d0 100644
--- a/tools/m4/child_property.m4
+++ b/tools/m4/child_property.m4
@@ -4,8 +4,8 @@ dnl Code generation sections for GtkContainer child properties
dnl
dnl
-dnl $1 $2 $3 $4 $5 $6
-dnl _CHILD_PROPERTY_PROXY(name, name_underscored, cpp_type, proxy_suffix, deprecated, docs)
+dnl $1 $2 $3 $4 $5 $6 $7
+dnl _CHILD_PROPERTY_PROXY(name, name_underscored, cpp_type, proxy_suffix, deprecated, docs, check_type)
dnl proxy_suffix could be "", "_WriteOnly" or "_ReadOnly"
dnl The method will be const if the propertyproxy is _ReadOnly.
dnl
@@ -24,6 +24,12 @@ ifelse($4,_ReadOnly,get,`ifelse($4,_WriteOnly,set,get or set)') the value of the
__PROXY_TYPE__ child_property_$2`'(ifelse($4,_ReadOnly,const ,)Gtk::Widget& child) ifelse($4,_ReadOnly,
const,);
_PUSH(SECTION_CC_PROPERTYPROXIES)
ifelse(`$5',,,`_DEPRECATE_IFDEF_START
+')dnl
+ifelse(`$7',,,`dnl
+static_assert(`$7'<_QUOTE($3)>::value,
+ "Type _QUOTE($3) cannot be used in _WRAP_CHILD_PROPERTY. "
+ "There is no suitable template specialization of Glib::Value<>.");
+
')dnl
__PROXY_TYPE__ __CPPNAME__::child_property_$2`'(ifelse($4,_ReadOnly,const ,)Gtk::Widget& child)
ifelse($4,_ReadOnly, const,)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]