mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-06 21:15:22 +00:00
Fix compilation error on 32bit
Below code failed to compile on a 32 bit machine with error
typewrappers.c: In function 'libvirt_intUnwrap':
typewrappers.c:135:5: error: logical 'and' of mutually exclusive tests is always false [-Werror=logical-op]
cc1: all warnings being treated as errors
The patch fixes this error.
(cherry picked from commit 4e9bb1dffd
)
This commit is contained in:
parent
ad8a04697f
commit
194d0b8b0a
@ -132,6 +132,7 @@ libvirt_intUnwrap(PyObject *obj, int *val)
|
|||||||
if ((long_val == -1) && PyErr_Occurred())
|
if ((long_val == -1) && PyErr_Occurred())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
#if LONG_MAX != INT_MAX
|
||||||
if (long_val >= INT_MIN && long_val <= INT_MAX) {
|
if (long_val >= INT_MIN && long_val <= INT_MAX) {
|
||||||
*val = long_val;
|
*val = long_val;
|
||||||
} else {
|
} else {
|
||||||
@ -139,6 +140,9 @@ libvirt_intUnwrap(PyObject *obj, int *val)
|
|||||||
"Python int too large to convert to C int");
|
"Python int too large to convert to C int");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
*val = long_val;
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user