]> xenbits.xensource.com Git - people/aperard/libvirt.git/commit
MacOS: Handle changes to xdrproc_t definition
authorDoug Goldstein <cardoe@cardoe.com>
Wed, 30 Oct 2013 16:22:58 +0000 (11:22 -0500)
committerDoug Goldstein <cardoe@cardoe.com>
Sun, 3 Nov 2013 15:34:10 +0000 (09:34 -0600)
commit9fa3a8ab6fd82ad2f5a14b490696085061418718
tree5b8367debdf0a17025d51af739529305c592b96d
parentba1bf10063a0205c1de12b209b0282833710214f
MacOS: Handle changes to xdrproc_t definition

With Mac OS X 10.9, xdrproc_t is no longer defined as:

typedef bool_t (*xdrproc_t)(XDR *, ...);

but instead as:

typdef bool_t (*xdrproc_t)(XDR *, void *, unsigned int);

For reference, Linux systems typically define it as:

typedef bool_t (*xdrproc_t)(XDR *, void *, ...);

The rationale explained in the header is that using a vararg is
incorrect and has a potential to change the ABI slightly do to compiler
optimizations taken and the undefined behavior. They decided
to specify the exact number of parameters and for compatibility with old
code decided to make the signature require 3 arguments. The third
argument is ignored for cases that its not used and its recommended to
supply a 0.
src/rpc/virnetmessage.c