Skip to content

Commit

Permalink
Fix SIM_test_ip for swig 4.2.0 and implemented review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
excaliburtb committed Apr 12, 2024
1 parent 1e0d781 commit b8aedd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libexec/trick/convert_swig
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ sub process_class($$$$$) {

if ( $curr_namespace ne "" ) {
my @split_namespaces = split "::", $curr_namespace;
my $sanitized_namespace = @split_namespaces[-1] ;
my $sanitized_namespace = $split_namespaces[-1] ;
my @namespace_split = split /namespace\s*$sanitized_namespace/, $$new_contents_ref;
$save_namespace_content = 'namespace ' . $sanitized_namespace . @namespace_split[-1];
$$new_contents_ref = join('namespace ' . $sanitized_namespace, @namespace_split[0 .. $#namespace_split-1]);
Expand Down
6 changes: 5 additions & 1 deletion test/SIM_test_ip/models/test_ip/include/Namespace_tests.hh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ namespace NS2 {
class B {
public :
//TODO: in the clang based convert_swig, we can use NS1 without the leading ::
//NS1::A< int > m ;
//Since swig 4.2.0, leading :: causes error.
#if SWIG_VERSION >= 0x040200
NS1::A< int > m ;
#else
::NS1::A< int > m ;
#endif
} ;
}
#endif
Expand Down

0 comments on commit b8aedd7

Please sign in to comment.