Skip to content

Commit 7839924

Browse files
committed
Fix: HPy payload type when compiling w/o bitcode
1 parent 34c71fa commit 7839924

File tree

1 file changed

+5
-0
lines changed
  • graalpython/com.oracle.graal.python.cext/include/hpy/cpython

1 file changed

+5
-0
lines changed

graalpython/com.oracle.graal.python.cext/include/hpy/cpython/misc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
If you need to convert HPy to PyObject* and vice-versa, you should use
3030
HPy_AsPyObject and HPy_FromPyObject.
3131
*/
32+
#ifdef GRAALVM_PYTHON_LLVM
3233
#define _h2py(h) ((PyObject*)h._i)
3334
#define _py2h(o) ((HPy){(void*)o})
35+
#else
36+
#define _h2py(h) ((PyObject*)h._i)
37+
#define _py2h(o) ((HPy){(intptr_t)o})
38+
#endif
3439

3540
// this should maybe autogenerated from public_api.h
3641
struct _HPyContext_s {

0 commit comments

Comments
 (0)