Skip to content

Commit 212d07f

Browse files
committed
sipify.pl: consider structs in exported classes also exported
1 parent 551a907 commit 212d07f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

scripts/sipify.pl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ sub detect_comment_block{
392392
pop(@global_bracket_nesting_index);
393393
pop(@ACCESS);
394394

395-
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."
396-
if $EXPORTED[-1] == 0;
395+
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."
396+
if $EXPORTED[-1] == 0;
397397

398-
pop @EXPORTED;
398+
pop @EXPORTED;
399399
}
400400
if ($#ACCESS == 0){
401401
dbg_info("reached top level");
@@ -461,7 +461,7 @@ sub detect_comment_block{
461461
if ( $line =~ m/^\s*struct(\s+\w+_EXPORT)?\s+\w+$/ ) {
462462
dbg_info(" going to struct => public");
463463
push @ACCESS, PUBLIC;
464-
push @EXPORTED, 0;
464+
push @EXPORTED, $EXPORTED[-1];
465465
push @global_bracket_nesting_index, 0;
466466
}
467467

@@ -476,7 +476,7 @@ sub detect_comment_block{
476476
my @template_inheritance_class = ();
477477
do {no warnings 'uninitialized';
478478
$classname = $3;
479-
$EXPORTED[-1]++ if $line =~ m/\b[A-Z]+_EXPORT\b/;
479+
$EXPORTED[-1]++ if $line =~ m/\b[A-Z]+_EXPORT\b/;
480480
};
481481
$line = "$1 $3";
482482
# Inheritance
@@ -634,10 +634,10 @@ sub detect_comment_block{
634634
$line =~ s/\bnullptr\b/0/g;
635635
$line =~ s/\s*=\s*default\b//g;
636636

637-
if( $line =~ /\w+_EXPORT/ ) {
638-
$EXPORTED[-1]++;
639-
$line =~ s/\b\w+_EXPORT\s+//g;
640-
}
637+
if( $line =~ /\w+_EXPORT/ ) {
638+
$EXPORTED[-1]++;
639+
$line =~ s/\b\w+_EXPORT\s+//g;
640+
}
641641

642642
# remove constructor definition, function bodies, member initializing list
643643
$SIP_RUN == 1 or detect_and_remove_following_body_or_initializerlist();

0 commit comments

Comments
 (0)