]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
rpc: genprotocol: Always apply fixups to rpcgen's output
authorPeter Krempa <pkrempa@redhat.com>
Wed, 8 Mar 2023 08:51:05 +0000 (09:51 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 13 Mar 2023 16:11:04 +0000 (17:11 +0100)
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>
src/rpc/genprotocol.pl

index f567260588cb1e835ac5815ac4bdfd65bc82360f..adf3991d7a363012523be5cbb3f744cd11f72bd9 100755 (executable)
@@ -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;