Skip to content
Permalink
Browse files
sipify.pl: consider structs in exported classes also exported
  • Loading branch information
jef-n committed May 21, 2017
1 parent 551a907 commit 212d07f3a28f2f06264d9a6b5b4790be7db764a7
Showing with 9 additions and 9 deletions.
  1. +9 −9 scripts/sipify.pl
@@ -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");
@@ -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;
}

@@ -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
@@ -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();

1 comment on commit 212d07f

@m-kuhn

This comment has been minimized.

Copy link
Member

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

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.