On Thu, Nov 30, 2023 at 09:24:15AM +0000, Daniel P. Berrangé wrote:
> macOS XDR library is an oddball using xdr_u_int64_t instead of
> xdr_uint64_t which everyone else has.
>
> The code generator already does the right thing, but the test
> program previously generated with the Linux rpcgen program
> does not compile on macOS due to this.
>
> Signed-off-by: Daniel P. Berrangé <[email protected]>
> ---
> scripts/rpcgen/tests/demo.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/scripts/rpcgen/tests/demo.c b/scripts/rpcgen/tests/demo.c
> index 182ed448f0..56a50239dc 100644
> --- a/scripts/rpcgen/tests/demo.c
> +++ b/scripts/rpcgen/tests/demo.c
> @@ -1,4 +1,8 @@
>
> +#ifdef __APPLE__
> +# define xdr_uint64_t xdr_u_int64_t
> +#endif
This makes the compilation error go away, but I'm not convinced it's
the right fix.
IIUC demo.{c,h} are generated from demo.x, so wouldn't this be
overwritten the next time we regenerate them?
Also both Linux and macOS have xdr_u_int64_t, and we already seem to
use the u_ variant for other things (u_short, u_int), so couldn't we
just use xdr_u_int64_t everywhere and avoid the conditional?
--
Andrea Bolognani / Red Hat / Virtualization
_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]