Skip to content

Commit

Permalink
Fix missing namespace macro warnings when building Qt Addon modules.
Browse files Browse the repository at this point in the history
Addon modules may not be in the standard Qt namespace and therefore do
not use the QT_{BEGIN,END}_NAMESPACE macros.  Instead module specific
QT_{BEGIN,END}_NAMESPACE_FOO macros are used.  Extend the syncqt test
to allow for this and ensure that the QT_END_NAMESPACE suffix matches
the QT_BEGIN_NAMESPACE suffix.

Change-Id: I33110c01118b0fb4376307db7447f747fc38bb29
Reviewed-by: Oswald Buddenhagen <[email protected]>
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
amccarthy authored and The Qt Project committed Feb 11, 2013
1 parent b61cff8 commit 0114a99
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/syncqt
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ if($check_includes) {
if(open(F, "<$iheader")) {
my $qt_begin_namespace_found = 0;
my $qt_end_namespace_found = 0;
my $qt_namespace_suffix = "";
my $line;
my $stop_processing = 0;
while($line = <F>) {
Expand All @@ -1196,9 +1197,10 @@ if($check_includes) {
}
}
}
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE\s*$/) {
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_BEGIN_NAMESPACE(_[A-Z_]+)?\s*$/) {
$qt_namespace_suffix = $1 // "";
$qt_begin_namespace_found = 1;
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE\s*$/) {
} elsif ($header_skip_qt_begin_namespace_test == 0 and $line =~ /^QT_END_NAMESPACE$qt_namespace_suffix\s*$/) {
$qt_end_namespace_found = 1;
}
}
Expand All @@ -1209,7 +1211,7 @@ if($check_includes) {
}

if ($qt_begin_namespace_found && $qt_end_namespace_found == 0) {
print "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE but no QT_END_NAMESPACE\n";
print "$lib: WARNING: $iheader has QT_BEGIN_NAMESPACE$qt_namespace_suffix but no QT_END_NAMESPACE$qt_namespace_suffix\n";
}
}

Expand Down

0 comments on commit 0114a99

Please sign in to comment.