From 1b7ff0693fe1f62302de883f20157bae22abe718 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 11 Jul 2015 13:51:01 +0300 Subject: [PATCH] dsdlc: fixed linker error (multiple definitions) --- .../libuavcan_dsdl_compiler/data_type_template.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl index 7a621125f9..8fd54b5db0 100644 --- a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl +++ b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl @@ -181,14 +181,14 @@ public: * If the union is set to another type, returns null pointer. */ template - const typename TagToType::StorageType* as() const; + inline const typename TagToType::StorageType* as() const; /** * Switches the union to the given type and returns a mutable reference to the appropriate field. * If the previous type was different, a default constructor will be called first. */ template - typename TagToType::StorageType& to(); + inline typename TagToType::StorageType& to(); % endif @@ -362,7 +362,7 @@ struct ${scope_prefix}<0>::TagToType<${scope_prefix}<0>::Tag::${a.name}> template <> template <> -const typename ${scope_prefix}<0>::TagToType< ${scope_prefix}<0>::Tag::${a.name} >::StorageType* +inline const typename ${scope_prefix}<0>::TagToType< ${scope_prefix}<0>::Tag::${a.name} >::StorageType* ${scope_prefix}<0>::as< ${scope_prefix}<0>::Tag::${a.name} >() const { return is(${scope_prefix}<0>::Tag::${a.name}) ? &${a.name} : NULL; @@ -370,7 +370,7 @@ ${scope_prefix}<0>::as< ${scope_prefix}<0>::Tag::${a.name} >() const template <> template <> -typename ${scope_prefix}<0>::TagToType< ${scope_prefix}<0>::Tag::${a.name} >::StorageType& +inline typename ${scope_prefix}<0>::TagToType< ${scope_prefix}<0>::Tag::${a.name} >::StorageType& ${scope_prefix}<0>::to< ${scope_prefix}<0>::Tag::${a.name} >() { if (_tag_ != ${idx})