diff --git a/bindings/python/ns3modulegen-modular.py b/bindings/python/ns3modulegen-modular.py index 9547e287a..2f5f178d1 100644 --- a/bindings/python/ns3modulegen-modular.py +++ b/bindings/python/ns3modulegen-modular.py @@ -73,6 +73,8 @@ def main(argv): root_module.set_name(extension_name) root_module.add_include('"ns3/%s-module.h"' % module_name) + ns3modulegen_core_customizations.add_std_ios_openmode(root_module) + # ----------- module_apidefs.register_types(root_module) diff --git a/bindings/python/ns3modulegen_core_customizations.py b/bindings/python/ns3modulegen_core_customizations.py index 419441fd7..218cae556 100644 --- a/bindings/python/ns3modulegen_core_customizations.py +++ b/bindings/python/ns3modulegen_core_customizations.py @@ -418,7 +418,11 @@ def add_std_ofstream(module): ofstream.add_constructor([Parameter.new("const char *", 'filename'), Parameter.new("::std::ofstream::openmode", 'mode', default_value="std::ios_base::out")]) ofstream.add_method('close', None, []) + + add_std_ios_openmode(module) + +def add_std_ios_openmode(module): import pybindgen.typehandlers.base for alias in "std::_Ios_Openmode", "std::ios::openmode": pybindgen.typehandlers.base.param_type_matcher.add_type_alias(alias, "int")