rpc: genprotocol: Always apply fixups to rpcgen's output

The platform check which determines when to apply the fixups mentions
all officially supported build targets (per docs/platforms.rst) thus
it's not really necessary.

Additionally while not explicitly written as supported the check does
not work properly when building with the MinGW toolchain on Windows as
it does not apply the needed transformations. They are necessary
there the same way as with MinGW on Linux.

https://gitlab.com/libvirt/libvirt/-/issues/453

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-03-08 09:51:05 +01:00
parent 7db8373e08
commit 06cc86d28a

View File

@ -1,6 +1,6 @@
#!/usr/bin/env perl
#
# Generate code for an XDR protocol, optionally applying
# Generate code for an XDR protocol, applying
# fixups to the glibc rpcgen code so that it compiles
# with warnings turned on.
#
@ -47,20 +47,11 @@ open RPCGEN, "-|", "$rpcgen $mode $xdrdef"
open TARGET, ">$target"
or die "cannot create $target: $!";
my $fixup = $^O eq "linux" || $^O eq "gnukfreebsd" || $^O eq "freebsd" || $^O eq "darwin";
if ($mode eq "-c") {
print TARGET "#include <config.h>\n";
}
while (<RPCGEN>) {
# We only want to fixup the GLibc rpcgen output
# So just print data unchanged, if non-Linux
unless ($fixup) {
print TARGET;
next;
}
if (m/^{/) {
$in_function = 1;
print TARGET;