diff --git a/scripts/sipify.pl b/scripts/sipify.pl index 2449f6d82c9..edc21c02b63 100755 --- a/scripts/sipify.pl +++ b/scripts/sipify.pl @@ -392,10 +392,10 @@ while ($line_idx < $line_count){ pop(@global_bracket_nesting_index); pop(@ACCESS); - die "Class $classname in $headerfile should be exported with appropriate [LIB]_EXPORT macro. If this should not be available in python, wrap it in a `#ifndef SIP_RUN` block." - if $EXPORTED[-1] == 0; + die "Class $classname in $headerfile should be exported with appropriate [LIB]_EXPORT macro. If this should not be available in python, wrap it in a `#ifndef SIP_RUN` block." + if $EXPORTED[-1] == 0; - pop @EXPORTED; + pop @EXPORTED; } if ($#ACCESS == 0){ dbg_info("reached top level"); @@ -461,7 +461,7 @@ while ($line_idx < $line_count){ if ( $line =~ m/^\s*struct(\s+\w+_EXPORT)?\s+\w+$/ ) { dbg_info(" going to struct => public"); push @ACCESS, PUBLIC; - push @EXPORTED, 0; + push @EXPORTED, $EXPORTED[-1]; push @global_bracket_nesting_index, 0; } @@ -476,7 +476,7 @@ while ($line_idx < $line_count){ my @template_inheritance_class = (); do {no warnings 'uninitialized'; $classname = $3; - $EXPORTED[-1]++ if $line =~ m/\b[A-Z]+_EXPORT\b/; + $EXPORTED[-1]++ if $line =~ m/\b[A-Z]+_EXPORT\b/; }; $line = "$1 $3"; # Inheritance @@ -634,10 +634,10 @@ while ($line_idx < $line_count){ $line =~ s/\bnullptr\b/0/g; $line =~ s/\s*=\s*default\b//g; - if( $line =~ /\w+_EXPORT/ ) { - $EXPORTED[-1]++; - $line =~ s/\b\w+_EXPORT\s+//g; - } + if( $line =~ /\w+_EXPORT/ ) { + $EXPORTED[-1]++; + $line =~ s/\b\w+_EXPORT\s+//g; + } # remove constructor definition, function bodies, member initializing list $SIP_RUN == 1 or detect_and_remove_following_body_or_initializerlist();