]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
lxc_monitor_protocol: Redefine xdr_uint64_t if needed
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Sep 2014 08:44:42 +0000 (10:44 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 26 Sep 2014 08:15:03 +0000 (10:15 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=993411

On some systems (using libtirpc instead of glibc's
implementation), xdr_uint64_t exists rather under different name:
xdr_u_int64_t. This makes compilation fail then:

libvirt_lxc-lxc_monitor_protocol.o: In function `xdr_virLXCMonitorInitEventMsg':
/usr/local/src/libvirt/libvirt-1.1.1/src/./lxc/lxc_monitor_protocol.c:31: undefined reference to `xdr_uint64_t'

Therefore we rather mirror the d707c866 commit and redefine
xdr_uint64_t if needed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/lxc/lxc_monitor_protocol.x

index 0926e26f64f16ed3701e941c7c69fec8af7eb2cb..3b66af5d8d6b737ea944e83b97cf5811b5213496 100644 (file)
@@ -4,6 +4,25 @@
  * the libvirt_lxc helper program.
  */
 
+/* cygwin's xdr implementation defines xdr_u_int64_t instead of xdr_uint64_t
+ * and lacks IXDR_PUT_INT32 and IXDR_GET_INT32
+ */
+%#ifdef HAVE_XDR_U_INT64_T
+%# define xdr_uint64_t xdr_u_int64_t
+%#endif
+%#ifndef IXDR_PUT_INT32
+%# define IXDR_PUT_INT32 IXDR_PUT_LONG
+%#endif
+%#ifndef IXDR_GET_INT32
+%# define IXDR_GET_INT32 IXDR_GET_LONG
+%#endif
+%#ifndef IXDR_PUT_U_INT32
+%# define IXDR_PUT_U_INT32 IXDR_PUT_U_LONG
+%#endif
+%#ifndef IXDR_GET_U_INT32
+%# define IXDR_GET_U_INT32 IXDR_GET_U_LONG
+%#endif
+
 enum virLXCMonitorExitStatus {
     VIR_LXC_MONITOR_EXIT_STATUS_ERROR,
     VIR_LXC_MONITOR_EXIT_STATUS_SHUTDOWN,