From 1a34e412a5c706cf097c783e3150f079b5397fed Mon Sep 17 00:00:00 2001 From: Siu Kwan Lam Date: Wed, 27 Feb 2013 19:27:34 -0600 Subject: [PATCH] Fix: "not" is not available on some compiler. --- llvmpy/include/capsulethunk.h | 2 +- llvmpy/include/llvm_binding/extra.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/llvmpy/include/capsulethunk.h b/llvmpy/include/capsulethunk.h index 9061782..6b1aba7 100644 --- a/llvmpy/include/capsulethunk.h +++ b/llvmpy/include/capsulethunk.h @@ -12,7 +12,7 @@ static void do_assert(int cond, const char * msg, const char *file, unsigned line){ - if (not cond) { + if (!cond) { fprintf(stderr, "Assertion failed %s:%d\n%s\n", file, line, msg); exit(1); } diff --git a/llvmpy/include/llvm_binding/extra.h b/llvmpy/include/llvm_binding/extra.h index b33a8a0..5838ae1 100644 --- a/llvmpy/include/llvm_binding/extra.h +++ b/llvmpy/include/llvm_binding/extra.h @@ -586,7 +586,7 @@ PyObject* Linker_LinkInModule(llvm::Linker* Linker, { std::string errmsg; bool failed = Linker->LinkInModule(Mod, &errmsg); - if (not failed) { + if (! failed) { Py_RETURN_FALSE; } else { if (-1 == PyFile_WriteString(errmsg.c_str(), ErrMsg)) { @@ -604,7 +604,7 @@ PyObject* Linker_LinkModules(llvm::Module* Dest, { std::string errmsg; bool failed = llvm::Linker::LinkModules(Dest, Src, Mode, &errmsg); - if (not failed) { + if (! failed) { Py_RETURN_FALSE; } else { if (-1 == PyFile_WriteString(errmsg.c_str(), ErrMsg)) { @@ -686,7 +686,7 @@ PyObject* ConstantArray_get(llvm::ArrayType* Ty, PyObject* Consts) std::vector vec_consts; bool ok = extract::from_py_sequence(vec_consts, Consts, "llvm::Value"); - if (not ok) return NULL; + if (! ok) return NULL; Constant* ary = ConstantArray::get(Ty, vec_consts); return pycapsule_new(ary, "llvm::Value", "llvm::Constant"); } @@ -699,7 +699,7 @@ PyObject* ConstantStruct_get(llvm::StructType* Ty, PyObject* Elems) std::vector vec_consts; bool ok = extract::from_py_sequence(vec_consts, Elems, "llvm::Value"); - if (not ok) return NULL; + if (! ok) return NULL; Constant* ary = ConstantStruct::get(Ty, vec_consts); return pycapsule_new(ary, "llvm::Value", "llvm::Constant"); } @@ -713,7 +713,7 @@ PyObject* ConstantStruct_getAnon(PyObject* Elems, std::vector vec_consts; bool ok = extract::from_py_sequence(vec_consts, Elems, "llvm::Value"); - if (not ok) return NULL; + if (! ok) return NULL; Constant* ary = ConstantStruct::getAnon(vec_consts, isPacked); return pycapsule_new(ary, "llvm::Value", "llvm::Constant"); } @@ -726,7 +726,7 @@ PyObject* ConstantVector_get(PyObject* Elems) std::vector vec_consts; bool ok = extract::from_py_sequence(vec_consts, Elems, "llvm::Value"); - if (not ok) return NULL; + if (! ok) return NULL; Constant* ary = ConstantVector::get(vec_consts); return pycapsule_new(ary, "llvm::Value", "llvm::Constant"); } @@ -756,7 +756,7 @@ PyObject* MDNode_get(llvm::LLVMContext &Cxt, PyObject* Vals) bool accept_null = true; bool ok = extract::from_py_sequence(vals, Vals, "llvm::Value", accept_null); - if (not ok) return NULL; + if (! ok) return NULL; llvm::MDNode* md = llvm::MDNode::get(Cxt, vals); return pycapsule_new(md, "llvm::Value", "llvm::MDNode"); } @@ -778,7 +778,7 @@ PyObject* IRBuilder_CreateAggregateRet(llvm::IRBuilder<>* builder, using namespace llvm; std::vector vec_values; bool ok = extract::from_py_sequence(vec_values, Vals, "llvm::Value"); - if (not ok) return NULL; + if (! ok) return NULL; Value** ptr_values = &vec_values[0]; ReturnInst* inst = builder->CreateAggregateRet(ptr_values, N); return pycapsule_new(inst, "llvm::Value", "llvm::ReturnInst");