Skip to content

Commit

Permalink
[sipify] remove EXPORT macro from struct definition
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Apr 24, 2017
1 parent 2a7d5d4 commit 419185b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/sipify.pl
Expand Up @@ -74,7 +74,7 @@ sub processDoxygenLine
while ($line_idx < $line_count){
$line = $lines[$line_idx];
$line_idx++;
#push @output, "$line\n";
#print "$line\n";

if ($line =~ m/^\s*SIP_FEATURE\( (\w+) \)(.*)$/){
push @output, "%Feature $1$2\n";
Expand Down Expand Up @@ -312,7 +312,7 @@ sub processDoxygenLine
push @output, "$line\n";
$line = $lines[$line_idx];
$line_idx++;
$line =~ m/^\s*\{\s*$/ || die 'Unexpected content: enum should be followed by {';
$line =~ m/^\s*\{\s*$/ || die "Unexpected content: enum should be followed by {\nline: $line";
push @output, "$line\n";
while ($line_idx < $line_count){
$line = $lines[$line_idx];
Expand Down Expand Up @@ -464,6 +464,9 @@ sub processDoxygenLine
next;
}

# remove export macro from struct definition
$line =~ s/^(\s*struct )\w+_EXPORT (.+)$/$1$2/;

$line =~ s/\bSIP_FACTORY\b/\/Factory\//;
$line =~ s/\bSIP_OUT\b/\/Out\//g;
$line =~ s/\bSIP_INOUT\b/\/In,Out\//g;
Expand Down
5 changes: 5 additions & 0 deletions tests/scripts/sipifyheader.expected.sip
Expand Up @@ -250,6 +250,11 @@ Removing function body with virtual const reference

bool initializedMember;

struct PublicStruct
{
int var;
}

protected:
bool thisShouldBeListed();
%Docstring
Expand Down
5 changes: 5 additions & 0 deletions tests/scripts/sipifyheader.h
Expand Up @@ -250,6 +250,11 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas

bool initializedMember{ false };

struct CORE_EXPORT PublicStruct
{
int var;
}

protected:
bool thisShouldBeListed();

Expand Down

0 comments on commit 419185b

Please sign in to comment.