Skip to content

Commit f26cd28

Browse files
committed
Fix compilation errors after HPy import update
1 parent d3954ee commit f26cd28

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

graalpython/com.oracle.graal.python.cext/include/universal/autogen_ctx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ typedef HPy _HPyConst;
3838
#define HPy void*
3939
#define HPyListBuilder void*
4040
#define HPyTupleBuilder void*
41+
#define HPyTracker void*
4142

4243

4344
struct _HPyContext_s {
@@ -167,3 +168,4 @@ struct _HPyContext_s {
167168
#undef HPy
168169
#undef HPyListBuilder
169170
#undef HPyTupleBuilder
171+
#undef HPyTracker

graalpython/com.oracle.graal.python.cext/include/universal/autogen_trampolines.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
#define WRAP_TUPLE_BUILDER(_ptr) ((HPyTupleBuilder){(_ptr)})
3939
#define UNWRAP_LIST_BUILDER(_h) ((_h)._lst)
4040
#define WRAP_LIST_BUILDER(_ptr) ((HPyListBuilder){(_ptr)})
41+
#define UNWRAP_TRACKER(_h) ((_h)._i)
42+
#define WRAP_TRACKER(_ptr) ((HPyTracker){(_ptr)})
4143

4244
static inline HPy HPyModule_Create(HPyContext ctx, HPyModuleDef *def) {
4345
return WRAP(ctx->ctx_Module_Create ( ctx, def ));
@@ -452,18 +454,18 @@ static inline void HPyTupleBuilder_Cancel(HPyContext ctx, HPyTupleBuilder builde
452454
}
453455

454456
static inline HPyTracker HPyTracker_New(HPyContext ctx, HPy_ssize_t size) {
455-
return ctx->ctx_Tracker_New ( ctx, size );
457+
return WRAP_TRACKER(ctx->ctx_Tracker_New ( ctx, size ));
456458
}
457459

458460
static inline int HPyTracker_Add(HPyContext ctx, HPyTracker ht, HPy h) {
459-
return ctx->ctx_Tracker_Add ( ctx, ht, h );
461+
return ctx->ctx_Tracker_Add ( ctx, UNWRAP_TRACKER(ht), UNWRAP(h) );
460462
}
461463

462464
static inline void HPyTracker_RemoveAll(HPyContext ctx, HPyTracker ht) {
463-
ctx->ctx_Tracker_RemoveAll ( ctx, ht );
465+
ctx->ctx_Tracker_RemoveAll ( ctx, UNWRAP_TRACKER(ht) );
464466
}
465467

466468
static inline void HPyTracker_Free(HPyContext ctx, HPyTracker ht) {
467-
ctx->ctx_Tracker_Free ( ctx, ht );
469+
ctx->ctx_Tracker_Free ( ctx, UNWRAP_TRACKER(ht) );
468470
}
469471

0 commit comments

Comments
 (0)