]> xenbits.xensource.com Git - libvirt.git/commitdiff
rpc: Make rpcgen produce ANSI C code
authorAndrea Bolognani <abologna@redhat.com>
Thu, 2 Nov 2023 23:04:29 +0000 (00:04 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 3 Nov 2023 11:03:23 +0000 (12:03 +0100)
This is the default for the version of rpcgen shipped with
Linux distributions, but the one in macOS and possibly others
default to K&R C, which modern compilers don't appreciate.

Luckily, all versions of rpcgen shipped with our target
platforms seem to support the -C option.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/rpc/genprotocol.pl

index adf3991d7a363012523be5cbb3f744cd11f72bd9..37216303dc0b85abf82b0cdf18d60211778306b4 100755 (executable)
@@ -41,6 +41,8 @@ unlink $target;
 
 if ($rpcgen =~ /portable-rpcgen/) {
     $rpcgen = "$rpcgen -o -";
+} else {
+    $rpcgen = "$rpcgen -C";
 }
 open RPCGEN, "-|", "$rpcgen $mode $xdrdef"
     or die "cannot run $rpcgen $mode $xdrdef: $!";