From 05ab57f865fb313c4dc0ecbff539f090f553fdeb Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Fri, 5 Jan 2018 09:19:45 -0800 Subject: [PATCH] bindings: (partial fix #2451) Handle std::_Ios_Openmode typedef std::_Ios_Openmode is a typedef of std::ios_base::openmode bitmask type. This mapping needs to be provided to the type handler. The previous mapping was for std::ios::openmode (ios is a subclass of ios_base), but the use of subclass here no longer works. Thanks to Gustavo Carneiro for a hint of where to address this issue in the bindings. --- bindings/python/ns3modulegen_core_customizations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/ns3modulegen_core_customizations.py b/bindings/python/ns3modulegen_core_customizations.py index aaf425d16..087aa361b 100644 --- a/bindings/python/ns3modulegen_core_customizations.py +++ b/bindings/python/ns3modulegen_core_customizations.py @@ -412,7 +412,7 @@ def add_std_ofstream(module): class IosOpenmodeParam(Parameter): DIRECTIONS = [Parameter.DIRECTION_IN] - CTYPES = ['std::ios::openmode', 'std::_Ios_Openmode'] + CTYPES = ['std::ios_base::openmode', 'std::_Ios_Openmode'] def convert_c_to_python(self, wrapper): assert isinstance(wrapper, ReverseWrapperBase) @@ -420,7 +420,7 @@ class IosOpenmodeParam(Parameter): def convert_python_to_c(self, wrapper): assert isinstance(wrapper, ForwardWrapperBase) - name = wrapper.declarations.declare_variable("std::ios::openmode", self.name, self.default_value) + name = wrapper.declarations.declare_variable("std::ios_base::openmode", self.name, self.default_value) wrapper.parse_params.add_parameter('i', ['&'+name], self.name, optional=bool(self.default_value)) wrapper.call_params.append(name)