Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sipify.pl: consider structs in exported classes also exported
  • Loading branch information
jef-n committed May 21, 2017
1 parent 551a907 commit 212d07f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/sipify.pl
Expand Up @@ -392,10 +392,10 @@ sub detect_comment_block{
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");
Expand Down Expand Up @@ -461,7 +461,7 @@ sub detect_comment_block{
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;
}

Expand All @@ -476,7 +476,7 @@ sub detect_comment_block{
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
Expand Down Expand Up @@ -634,10 +634,10 @@ sub detect_comment_block{
$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();
Expand Down

1 comment on commit 212d07f

@m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented on 212d07f May 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you realize that you should have just waited a couple of more minutes

$ git log --oneline
dcc75d2813 Reindent sipify.pl
dcc75d2813 Fix sipify.pl
$ git push
To github.com:qgis/QGIS.git
 ! [rejected]              master -> master (non-fast-forward)

Please sign in to comment.