gh-116417: Fix WASI build of _testlimitedcapi (#116974)

Use different function names between _testcapi and _testlimitedcapi
to not confuse the WASI linker.
This commit is contained in:
Victor Stinner 2024-03-18 23:06:52 +01:00 committed by GitHub
parent 165cb4578c
commit dc2d0f4654
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 26 additions and 24 deletions

View File

@ -26,28 +26,28 @@ PyInit__testlimitedcapi(void)
return NULL; return NULL;
} }
if (_PyTestCapi_Init_ByteArray(mod) < 0) { if (_PyTestLimitedCAPI_Init_ByteArray(mod) < 0) {
return NULL; return NULL;
} }
if (_PyTestCapi_Init_Bytes(mod) < 0) { if (_PyTestLimitedCAPI_Init_Bytes(mod) < 0) {
return NULL; return NULL;
} }
if (_PyTestCapi_Init_HeaptypeRelative(mod) < 0) { if (_PyTestLimitedCAPI_Init_HeaptypeRelative(mod) < 0) {
return NULL; return NULL;
} }
if (_PyTestCapi_Init_List(mod) < 0) { if (_PyTestLimitedCAPI_Init_List(mod) < 0) {
return NULL; return NULL;
} }
if (_PyTestCapi_Init_PyOS(mod) < 0) { if (_PyTestLimitedCAPI_Init_PyOS(mod) < 0) {
return NULL; return NULL;
} }
if (_PyTestCapi_Init_Set(mod) < 0) { if (_PyTestLimitedCAPI_Init_Set(mod) < 0) {
return NULL; return NULL;
} }
if (_PyTestCapi_Init_Sys(mod) < 0) { if (_PyTestLimitedCAPI_Init_Sys(mod) < 0) {
return NULL; return NULL;
} }
if (_PyTestCapi_Init_VectorcallLimited(mod) < 0) { if (_PyTestLimitedCAPI_Init_VectorcallLimited(mod) < 0) {
return NULL; return NULL;
} }
return mod; return mod;

View File

@ -113,7 +113,7 @@ static PyMethodDef test_methods[] = {
}; };
int int
_PyTestCapi_Init_ByteArray(PyObject *m) _PyTestLimitedCAPI_Init_ByteArray(PyObject *m)
{ {
if (PyModule_AddFunctions(m, test_methods) < 0) { if (PyModule_AddFunctions(m, test_methods) < 0) {
return -1; return -1;

View File

@ -245,7 +245,7 @@ static PyMethodDef test_methods[] = {
}; };
int int
_PyTestCapi_Init_Bytes(PyObject *m) _PyTestLimitedCAPI_Init_Bytes(PyObject *m)
{ {
if (PyModule_AddFunctions(m, test_methods) < 0) { if (PyModule_AddFunctions(m, test_methods) < 0) {
return -1; return -1;

View File

@ -331,7 +331,8 @@ static PyMethodDef TestMethods[] = {
}; };
int int
_PyTestCapi_Init_HeaptypeRelative(PyObject *m) { _PyTestLimitedCAPI_Init_HeaptypeRelative(PyObject *m)
{
if (PyModule_AddFunctions(m, TestMethods) < 0) { if (PyModule_AddFunctions(m, TestMethods) < 0) {
return -1; return -1;
} }

View File

@ -159,7 +159,7 @@ static PyMethodDef test_methods[] = {
}; };
int int
_PyTestCapi_Init_List(PyObject *m) _PyTestLimitedCAPI_Init_List(PyObject *m)
{ {
if (PyModule_AddFunctions(m, test_methods) < 0) { if (PyModule_AddFunctions(m, test_methods) < 0) {
return -1; return -1;

View File

@ -22,13 +22,13 @@
# error "Py_BUILD_CORE macro must not be defined" # error "Py_BUILD_CORE macro must not be defined"
#endif #endif
int _PyTestCapi_Init_ByteArray(PyObject *module); int _PyTestLimitedCAPI_Init_ByteArray(PyObject *module);
int _PyTestCapi_Init_Bytes(PyObject *module); int _PyTestLimitedCAPI_Init_Bytes(PyObject *module);
int _PyTestCapi_Init_HeaptypeRelative(PyObject *module); int _PyTestLimitedCAPI_Init_HeaptypeRelative(PyObject *module);
int _PyTestCapi_Init_List(PyObject *module); int _PyTestLimitedCAPI_Init_List(PyObject *module);
int _PyTestCapi_Init_PyOS(PyObject *module); int _PyTestLimitedCAPI_Init_PyOS(PyObject *module);
int _PyTestCapi_Init_Set(PyObject *module); int _PyTestLimitedCAPI_Init_Set(PyObject *module);
int _PyTestCapi_Init_Sys(PyObject *module); int _PyTestLimitedCAPI_Init_Sys(PyObject *module);
int _PyTestCapi_Init_VectorcallLimited(PyObject *module); int _PyTestLimitedCAPI_Init_VectorcallLimited(PyObject *module);
#endif // Py_TESTLIMITEDCAPI_PARTS_H #endif // Py_TESTLIMITEDCAPI_PARTS_H

View File

@ -50,7 +50,7 @@ static PyMethodDef test_methods[] = {
}; };
int int
_PyTestCapi_Init_PyOS(PyObject *mod) _PyTestLimitedCAPI_Init_PyOS(PyObject *mod)
{ {
if (PyModule_AddFunctions(mod, test_methods) < 0) { if (PyModule_AddFunctions(mod, test_methods) < 0) {
return -1; return -1;

View File

@ -179,7 +179,7 @@ static PyMethodDef test_methods[] = {
}; };
int int
_PyTestCapi_Init_Set(PyObject *m) _PyTestLimitedCAPI_Init_Set(PyObject *m)
{ {
if (PyModule_AddFunctions(m, test_methods) < 0) { if (PyModule_AddFunctions(m, test_methods) < 0) {
return -1; return -1;

View File

@ -46,7 +46,7 @@ static PyMethodDef test_methods[] = {
}; };
int int
_PyTestCapi_Init_Sys(PyObject *m) _PyTestLimitedCAPI_Init_Sys(PyObject *m)
{ {
if (PyModule_AddFunctions(m, test_methods) < 0) { if (PyModule_AddFunctions(m, test_methods) < 0) {
return -1; return -1;

View File

@ -182,7 +182,8 @@ static PyMethodDef TestMethods[] = {
}; };
int int
_PyTestCapi_Init_VectorcallLimited(PyObject *m) { _PyTestLimitedCAPI_Init_VectorcallLimited(PyObject *m)
{
if (PyModule_AddFunctions(m, TestMethods) < 0) { if (PyModule_AddFunctions(m, TestMethods) < 0) {
return -1; return -1;
} }