mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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>
This commit is contained in:
1 parent
7062ac62f0
commit
6c1cb3dba4
1 file changed
+5
-8
@@ -1641,12 +1641,9 @@ failed:
|
||||
return -1;
|
||||
}
|
||||
|
||||
#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,
|
||||
@@ -1669,7 +1666,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;
|
||||
@@ -1705,7 +1702,7 @@ int xc_domain_memory_mapping(
|
||||
|
||||
return ret;
|
||||
}
|
||||
#undef min
|
||||
#undef min_t
|
||||
int xc_domain_ioport_mapping(
|
||||
xc_interface *xch,
|
||||
uint32_t domid,
|
||||
|
||||