diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-08-25 14:46:03 -0300 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-09-06 13:43:10 -0300 |
commit | ee3894946a79179c1869836b9dae28ec7b3a01e5 (patch) | |
tree | 44e9406ab74a8d67126d3167dbf94f5cdb27e84c | |
parent | 5d903a64aca37ee7c2836e479e175336e9b7ca87 (diff) |
findclasslist.pl: do match subclasses in private headers too
I noticed that the QtCore version file had several entries for
13QObjectPrivate, which turns out to be for all the nested structs
inside. That's not harmful for QObjectPrivate, since that is itself a
private, but would be a problem for a nested struct of a public class.
I'm sure those exist.
Pick-to: 6.4
Change-Id: Ic6547f8247454b47baa8fffd170ea79360aaa615
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | mkspecs/features/data/unix/findclasslist.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mkspecs/features/data/unix/findclasslist.pl b/mkspecs/features/data/unix/findclasslist.pl index 3d224aeedf..59ce4ab2c5 100644 --- a/mkspecs/features/data/unix/findclasslist.pl +++ b/mkspecs/features/data/unix/findclasslist.pl @@ -8,10 +8,10 @@ my $syntax = "findclasslist.pl\n" . # Match a struct or class declaration at the top-level, but not a forward # declaration -my $classmatch = qr/^(?:struct|class)(?:\s+Q_\w*_EXPORT)?\s+(\w+)(\s*;$)?/; +my $classmatch = qr/^(?:struct|class)(?:\s+Q_\w*_EXPORT)?\s+([\w:]+)(\s*;$)?/; # Match an exported namespace -my $nsmatch = qr/^namespace\s+Q_\w+_EXPORT\s+(\w+)/; +my $nsmatch = qr/^namespace\s+Q_\w+_EXPORT\s+([\w:]+)/; $\ = $/; while (<STDIN>) { @@ -35,7 +35,11 @@ while (<STDIN>) { next unless $line =~ $nsmatch or $line =~ $classmatch; next if $2 ne ""; # forward declaration - printf " *%d%s*;\n", length $1, $1; + # split the namespace-qualified or nested class identifiers + my $sym = ($1 =~ s/:$//r); # remove trailing : + my @sym = split /::/, $sym; + @sym = map { sprintf "%d%s", length $_, $_; } @sym; + printf " *%s*;\n", join("", @sym); $comment = 0; } close HDR; |