tools/libxc: Fix build of 32bit toolstacks on CentOS 5.x following XSA-125

gcc 4.1 of CentOS 5.x era does not like the typecheck in min() between
uint64_t and unsigned long.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>

(cherry picked from commit 6c1cb3dba4)
Conflicts:
	tools/libxc/xc_domain.c
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Andrew Cooper authored and Ian Jackson committed 2015-08-12 12:04:09 +01:00
1 parent 9d6754dc2d
commit c776b6429b
1 file changed
+5 -8
+5 -8
View File
@@ -1467,12 +1467,9 @@ int xc_domain_bind_pt_isa_irq(
PT_IRQ_TYPE_ISA, 0, 0, 0, machine_irq));
}
#ifndef min
#define min(X, Y) ({ \
const typeof (X) _x = (X); \
const typeof (Y) _y = (Y); \
(void) (&_x == &_y); \
(_x < _y) ? _x : _y; })
#ifndef min_t
#define min_t(type,x,y) \
({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
#endif
int xc_domain_memory_mapping(
xc_interface *xch,
@@ -1495,7 +1492,7 @@ int xc_domain_memory_mapping(
max_batch_sz = nr_mfns;
do
{
nr = min(nr_mfns - done, max_batch_sz);
nr = min_t(unsigned long, nr_mfns - done, max_batch_sz);
domctl.u.memory_mapping.nr_mfns = nr;
domctl.u.memory_mapping.first_gfn = first_gfn + done;
domctl.u.memory_mapping.first_mfn = first_mfn + done;
@@ -1531,7 +1528,7 @@ int xc_domain_memory_mapping(
return ret;
}
#undef min
#undef min_t
int xc_domain_ioport_mapping(
xc_interface *xch,
uint32_t domid,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.