From 845697bf11665f2751f5b89666f272155d2db9e0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 25 Aug 2022 17:53:43 -0300 Subject: [PATCH] findclasslist.pl: add a way to mark lines to be ignored MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In case they get erroneously extracted. For example, in Core5Compat, QTextCodec appears in the _p.h as a full class if !QT_CONFIG(textcodec) (I don't know what that is for, but it's there). Pick-to: 6.4 Change-Id: Ic6547f8247454b47baa8fffd170eb1d0f7e6d0f9 Reviewed-by: Jörg Bornemann --- mkspecs/features/data/unix/findclasslist.pl | 6 ++++++ src/dbus/dbus_minimal_p.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/mkspecs/features/data/unix/findclasslist.pl b/mkspecs/features/data/unix/findclasslist.pl index 4971dcb5ba..ca5f856156 100644 --- a/mkspecs/features/data/unix/findclasslist.pl +++ b/mkspecs/features/data/unix/findclasslist.pl @@ -18,6 +18,12 @@ while () { open HDR, "<$1" or die("Could not open header $1: $!"); my $comment = " /* $1 */"; while (my $line = ) { + if ($line =~ /\bELFVERSION:(\S+)\b/) { + last if $1 eq "stop"; + if $1 eq "ignore-next"; # load next line + next if $1 eq "ignore" or $1 eq "ignore-next"; + } + # Match a struct or class declaration, but not a forward declaration $line =~ /^(?:struct|class|namespace) (?:Q_.*_EXPORT)? (\w+)(?!;)/ or next; print $comment if $comment; diff --git a/src/dbus/dbus_minimal_p.h b/src/dbus/dbus_minimal_p.h index 270ff8a4ed..c4f82b85e2 100644 --- a/src/dbus/dbus_minimal_p.h +++ b/src/dbus/dbus_minimal_p.h @@ -15,6 +15,8 @@ // We mean it. // +// These structures are not ours, so ELFVERSION:stop + extern "C" { // Equivalent to dbus-arch-deps.h (generated from dbus-arch-deps.h.in)