It compiles! It also segfaults when tested! :D

This commit is contained in:
AndrewBC 2011-06-12 03:41:03 -05:00
commit 13815fd2f3
6 changed files with 923 additions and 159 deletions

View file

@ -30,22 +30,36 @@
#include "wrap.h"
/* Project-wide setting */
#if (PY_MAJOR_VERSION >= 3)
#define LLVM_PY_USE_PYCAPSULE
#endif
/*===----------------------------------------------------------------------===*/
/* Helper functions/macros */
/*===----------------------------------------------------------------------===*/
#ifdef LLVM_PY_USE_PYCAPSULE
#define _define_std_ctor(typ) \
PyObject * ctor_ ## typ ( typ p) \
{ \
if (p) \
#ifdef LLVM_PY_USE_PYCAPSULE \
return PyCapsule_New(p, NULL, NULL); \
#else \
return PyCObject_FromVoidPtr(p, NULL); \
#endif \
Py_RETURN_NONE; \
}
#else
#define _define_std_ctor(typ) \
PyObject * ctor_ ## typ ( typ p) \
{ \
if (p) \
return PyCObject_FromVoidPtr(p, NULL); \
Py_RETURN_NONE; \
}
#endif
/*===----------------------------------------------------------------------===*/
/* Type ctor/dtor */