Path: blob/main/python/cpython/src/patches/01-main.patch
1067 views
--- native/Programs/python.c 2022-09-11 12:23:30.000000000 -07001+++ wasm/Programs/python.c 2022-10-19 10:26:04.000000000 -07002@@ -2,6 +2,11 @@34#include "Python.h"56+// This C file, which is defined right now in the dylink nodejs module, adds7+// the declaration that make everything extension modules need8+// accessible from outside our "python.wasm as a shared library".9+#include "libpython.c"10+11#ifdef MS_WINDOWS12int13wmain(int argc, wchar_t **argv)14@@ -9,6 +14,11 @@15return Py_Main(argc, argv);16}17#else18+19+// Make the main symbol visible. We do this explicitly since our trick with #define main20+// doesn't work with python, due to there being other code that uses main as a struct attribute.21+22+__attribute__((visibility("default")))23int24main(int argc, char **argv)25{262728