Skip to content

Commit b863d5c

Browse files
committed
Add some Windows-only C API funtions
1 parent f962204 commit b863d5c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

graalpython/com.oracle.graal.python.processor/src/com/oracle/graal/python/processor/CApiBuiltinsProcessor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,10 @@ private static Path resolvePath(Path path) {
748748
"_PyCFunction_SetModule", "_PyCFunction_SetMethodDef",
749749
"PyCode_GetFileName", "_PyArray_Resize", "_PyArray_Data",
750750
"_PyErr_Occurred", "_PyNamespace_New", "_Py_GetErrorHandler",
751+
// Not actually additional, only defined on Windows.
752+
// TODO: fix generated CAPIFunctions.txt
753+
"PyUnicode_AsMBCSString", "PyUnicode_EncodeCodePage", "PyUnicode_DecodeMBCS",
754+
"PyUnicode_DecodeCodePageStateful", "PyUnicode_DecodeMBCSStateful",
751755
};
752756

753757
public String resolveArgDescriptor(String sig) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/CApiFunction.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,12 @@ public final class CApiFunction {
12381238
@CApiBuiltin(name = "_PyInterpreterState_HasFeature", ret = PrimitiveResult32, args = {PyInterpreterState, UNSIGNED_LONG}, call = CImpl)
12391239
@CApiBuiltin(name = "_PyImport_AcquireLock", ret = Void, args = {PyInterpreterState}, call = NotImplemented)
12401240
@CApiBuiltin(name = "_PyImport_ReleaseLock", ret = PrimitiveResult32, args = {PyInterpreterState}, call = NotImplemented)
1241+
// Windows only functions
1242+
@CApiBuiltin(name = "PyUnicode_DecodeMBCS", ret = PyObject, args = {ConstCharPtr, Py_ssize_t, ConstCharPtr}, call = NotImplemented)
1243+
@CApiBuiltin(name = "PyUnicode_DecodeMBCSStateful", ret = PyObject, args = {ConstCharPtr, Py_ssize_t, ConstCharPtr, PY_SSIZE_T_PTR}, call = NotImplemented)
1244+
@CApiBuiltin(name = "PyUnicode_DecodeCodePageStateful", ret = PyObject, args = {Int, ConstCharPtr, Py_ssize_t, ConstCharPtr, PY_SSIZE_T_PTR}, call = NotImplemented)
1245+
@CApiBuiltin(name = "PyUnicode_AsMBCSString", ret = PyObject, args = {PyObject}, call = NotImplemented)
1246+
@CApiBuiltin(name = "PyUnicode_EncodeCodePage", ret = PyObject, args = {Int, PyObject, ConstCharPtr}, call = NotImplemented)
12411247

12421248
private static final class Dummy {
12431249
// only here for the annotations

0 commit comments

Comments
 (0)