From 9b63e2d59734d0298f7667dd63103b219a50708e Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Thu, 19 Nov 2009 11:19:39 +0000 Subject: [PATCH] Patch the bad default_value given by gccxml in the case of MilliSeconds(0) --- bindings/python/ns3modulescan.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bindings/python/ns3modulescan.py b/bindings/python/ns3modulescan.py index 25ae30e81..1a2530f29 100644 --- a/bindings/python/ns3modulescan.py +++ b/bindings/python/ns3modulescan.py @@ -8,7 +8,7 @@ from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, from pybindgen.typehandlers.codesink import FileCodeSink from pygccxml.declarations import templates from pygccxml.declarations.class_declaration import class_t -from pygccxml.declarations.calldef import free_function_t, member_function_t, constructor_t +from pygccxml.declarations.calldef import free_function_t, member_function_t, constructor_t, calldef_t ## we need the smart pointer type transformation to be active even @@ -161,6 +161,13 @@ def pre_scan_hook(dummy_module_parser, and pygccxml_definition.name == 'Run': global_annotations['ignore'] = True + ## http://www.gccxml.org/Bug/view.php?id=9915 + if isinstance(pygccxml_definition, calldef_t): + for arg in pygccxml_definition.arguments: + if arg.default_value is None: + continue + if "ns3::MilliSeconds( )" == arg.default_value: + arg.default_value = "ns3::MilliSeconds(0)" ## classes if isinstance(pygccxml_definition, class_t):