Skip to content

Commit 3979198

Browse files
committed
Regenerate C API forwards
1 parent 947befc commit 3979198

File tree

4 files changed

+1189
-1165
lines changed

4 files changed

+1189
-1165
lines changed

graalpython/com.oracle.graal.python.cext/src/capi.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,6 +1529,14 @@ PyAPI_FUNC(PyCodeObject*) PyCode_NewEmpty(const char* a, const char* b, int c) {
15291529
PyAPI_FUNC(PyCodeObject*) PyCode_NewWithPosOnlyArgs(int a, int b, int c, int d, int e, int f, PyObject* g, PyObject* h, PyObject* i, PyObject* j, PyObject* k, PyObject* l, PyObject* m, PyObject* n, int o, PyObject* p) {
15301530
return GraalPyCode_NewWithPosOnlyArgs(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p);
15311531
}
1532+
#undef PyCodec_Decoder
1533+
PyAPI_FUNC(PyObject*) PyCodec_Decoder(const char* a) {
1534+
return GraalPyCodec_Decoder(truffleString(a));
1535+
}
1536+
#undef PyCodec_Encoder
1537+
PyAPI_FUNC(PyObject*) PyCodec_Encoder(const char* a) {
1538+
return GraalPyCodec_Encoder(truffleString(a));
1539+
}
15321540
#undef PyComplex_FromDoubles
15331541
PyAPI_FUNC(PyObject*) PyComplex_FromDoubles(double a, double b) {
15341542
return GraalPyComplex_FromDoubles(a, b);

graalpython/com.oracle.graal.python.cext/src/capi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ typedef struct {
120120
BUILTIN(PyCode_New, PyCodeObject*, int, int, int, int, int, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, int, PyObject*) \
121121
BUILTIN(PyCode_NewEmpty, PyCodeObject*, const char*, const char*, int) \
122122
BUILTIN(PyCode_NewWithPosOnlyArgs, PyCodeObject*, int, int, int, int, int, int, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, int, PyObject*) \
123+
BUILTIN(PyCodec_Decoder, PyObject*, const char*) \
124+
BUILTIN(PyCodec_Encoder, PyObject*, const char*) \
123125
BUILTIN(PyComplex_FromDoubles, PyObject*, double, double) \
124126
BUILTIN(PyComplex_ImagAsDouble, double, PyObject*) \
125127
BUILTIN(PyComplex_RealAsDouble, double, PyObject*) \

graalpython/com.oracle.graal.python.jni/src/capi_forwards.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,14 +1937,18 @@ PyAPI_FUNC(PyObject*) PyCodec_BackslashReplaceErrors(PyObject* a) {
19371937
PyAPI_FUNC(PyObject*) PyCodec_Decode(PyObject* a, const char* b, const char* c) {
19381938
unimplemented("PyCodec_Decode"); exit(-1);
19391939
}
1940+
PyObject* (*__target__PyCodec_Decoder)(const char*) = NULL;
19401941
PyAPI_FUNC(PyObject*) PyCodec_Decoder(const char* a) {
1941-
unimplemented("PyCodec_Decoder"); exit(-1);
1942+
PyObject* result = (PyObject*) __target__PyCodec_Decoder(a);
1943+
return result;
19421944
}
19431945
PyAPI_FUNC(PyObject*) PyCodec_Encode(PyObject* a, const char* b, const char* c) {
19441946
unimplemented("PyCodec_Encode"); exit(-1);
19451947
}
1948+
PyObject* (*__target__PyCodec_Encoder)(const char*) = NULL;
19461949
PyAPI_FUNC(PyObject*) PyCodec_Encoder(const char* a) {
1947-
unimplemented("PyCodec_Encoder"); exit(-1);
1950+
PyObject* result = (PyObject*) __target__PyCodec_Encoder(a);
1951+
return result;
19481952
}
19491953
PyAPI_FUNC(PyObject*) PyCodec_IgnoreErrors(PyObject* a) {
19501954
unimplemented("PyCodec_IgnoreErrors"); exit(-1);
@@ -6260,6 +6264,8 @@ void initializeCAPIForwards(void* (*getAPI)(const char*)) {
62606264
__target__PyCapsule_New = getAPI("PyCapsule_New");
62616265
__target__PyCapsule_SetName = getAPI("PyCapsule_SetName");
62626266
__target__PyCode_NewEmpty = getAPI("PyCode_NewEmpty");
6267+
__target__PyCodec_Decoder = getAPI("PyCodec_Decoder");
6268+
__target__PyCodec_Encoder = getAPI("PyCodec_Encoder");
62636269
__target__PyContextVar_Get = getAPI("PyContextVar_Get");
62646270
__target__PyContextVar_New = getAPI("PyContextVar_New");
62656271
__target__PyDescrObject_GetName = getAPI("PyDescrObject_GetName");

0 commit comments

Comments
 (0)