summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2012-04-10 06:24:03 -0400
committerDaniel P. Berrange <berrange@redhat.com>2012-04-16 12:40:44 +0100
commitaa898432f174e90b9039d93befe2fd3faa43f1a5 (patch)
treebb5f14e2017ddb8d03802c056e37d85d5ee6f9f1
parent8228a55140f0dac5ddb1e4d78dc899d428e1e07b (diff)
downloadlibvirt-python-split-aa898432f174e90b9039d93befe2fd3faa43f1a5.tar.gz
libvirt-python-split-aa898432f174e90b9039d93befe2fd3faa43f1a5.tar.xz
libvirt-python-split-aa898432f174e90b9039d93befe2fd3faa43f1a5.zip
Fix compilation error on 32bitv0.9.11.2v0.9.11.1
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 4e9bb1dffdf456282b69ab077288c9bf875b8afa)
-rw-r--r--typewrappers.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/typewrappers.c b/typewrappers.c
index 026cb6b..c525e59 100644
--- a/typewrappers.c
+++ b/typewrappers.c
@@ -132,6 +132,7 @@ libvirt_intUnwrap(PyObject *obj, int *val)
if ((long_val == -1) && PyErr_Occurred())
return -1;
+#if LONG_MAX != INT_MAX
if (long_val >= INT_MIN && long_val <= INT_MAX) {
*val = long_val;
} else {
@@ -139,6 +140,9 @@ libvirt_intUnwrap(PyObject *obj, int *val)
"Python int too large to convert to C int");
return -1;
}
+#else
+ *val = long_val;
+#endif
return 0;
}