From d9c2ec696dde230a2a6fd562c048f9f63cf1122c Mon Sep 17 00:00:00 2001 From: Siu Kwan Lam Date: Wed, 27 Feb 2013 19:31:26 -0600 Subject: [PATCH] Fix: "and" is not available in all compilers. --- llvmpy/include/llvm_binding/conversion.h | 8 ++++---- llvmpy/include/llvm_binding/extra.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/llvmpy/include/llvm_binding/conversion.h b/llvmpy/include/llvm_binding/conversion.h index 8c9e3fc..0d65fa9 100644 --- a/llvmpy/include/llvm_binding/conversion.h +++ b/llvmpy/include/llvm_binding/conversion.h @@ -90,7 +90,7 @@ int py_str_to(PyObject *strobj, const char* &strref){ static int py_int_to(PyObject *intobj, int64_t & val){ - if (!PyInt_Check(intobj) and !PyLong_Check(intobj)) { + if (!PyInt_Check(intobj) && !PyLong_Check(intobj)) { // raise TypeError PyErr_SetString(PyExc_TypeError, "Expecting an int"); return 0; @@ -111,7 +111,7 @@ int py_int_to(PyObject *intobj, int64_t & val){ static int py_int_to(PyObject *intobj, unsigned & val){ - if (!PyInt_Check(intobj) and !PyLong_Check(intobj)) { + if (!PyInt_Check(intobj) && !PyLong_Check(intobj)) { // raise TypeError PyErr_SetString(PyExc_TypeError, "Expecting an int"); return 0; @@ -123,7 +123,7 @@ int py_int_to(PyObject *intobj, unsigned & val){ static int py_int_to(PyObject *intobj, unsigned long long & val){ - if (!PyInt_Check(intobj) and !PyLong_Check(intobj)) { + if (!PyInt_Check(intobj) && !PyLong_Check(intobj)) { // raise TypeError; PyErr_SetString(PyExc_TypeError, "Expecting an int"); return 0; @@ -148,7 +148,7 @@ int py_int_to(PyObject *intobj, unsigned long & val){ static int py_int_to(PyObject *intobj, void* & val){ - if (!PyInt_Check(intobj) and !PyLong_Check(intobj)) { + if (!PyInt_Check(intobj) && !PyLong_Check(intobj)) { // raise TypeError PyErr_SetString(PyExc_TypeError, "Expecting an int"); return 0; diff --git a/llvmpy/include/llvm_binding/extra.h b/llvmpy/include/llvm_binding/extra.h index 5838ae1..0e2d0a0 100644 --- a/llvmpy/include/llvm_binding/extra.h +++ b/llvmpy/include/llvm_binding/extra.h @@ -201,7 +201,7 @@ struct extract { if (!item) { return false; } - if (accept_null and Py_None == *item) { + if (accept_null && Py_None == *item) { vec.push_back(NULL); } else { auto_pyobject capsule = PyObject_GetAttrString(*item, "_ptr");