summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Tishler <jason@tishler.net>2003-09-04 11:59:50 +0000
committerJason Tishler <jason@tishler.net>2003-09-04 11:59:50 +0000
commit6bc06eca70f4c41f01bca5f39d54ff5f71a39092 (patch)
tree90e451559ee87d6762cebdf789eba30c0c4fa660
parent3076559ea5d36d9795edc32e2fae7949b875d7ef (diff)
downloadcpython-git-6bc06eca70f4c41f01bca5f39d54ff5f71a39092.tar.gz
Bug #794140: cygwin builds do not embed
The embed2.diff patch solves the user's problem by exporting the missing symbols from the Python core so Python can be embedded in another Cygwin application (well, at lest vim).
-rw-r--r--Include/pyport.h7
-rw-r--r--Modules/gcmodule.c2
-rw-r--r--Python/import.c2
-rw-r--r--Python/marshal.c2
4 files changed, 9 insertions, 4 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 06ce6ab56b..8747271cf2 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -428,7 +428,12 @@ extern double hypot(double, double);
# define PyAPI_FUNC(RTYPE) __declspec(dllexport) RTYPE
# define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE
/* module init functions inside the core need no external linkage */
-# define PyMODINIT_FUNC void
+ /* except for Cygwin to handle embedding (FIXME: BeOS too?) */
+# if defined(__CYGWIN__)
+# define PyMODINIT_FUNC __declspec(dllexport) void
+# else /* __CYGWIN__ */
+# define PyMODINIT_FUNC void
+# endif /* __CYGWIN__ */
# else /* Py_BUILD_CORE */
/* Building an extension module, or an embedded situation */
/* public Python functions and data are imported */
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index bb40b8f9c7..6442fe5452 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -951,7 +951,7 @@ static PyMethodDef GcMethods[] = {
{NULL, NULL} /* Sentinel */
};
-void
+PyMODINIT_FUNC
initgc(void)
{
PyObject *m;
diff --git a/Python/import.c b/Python/import.c
index 858f9e57c4..abe3a1907d 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -2841,7 +2841,7 @@ setint(PyObject *d, char *name, int value)
return err;
}
-void
+PyMODINIT_FUNC
initimp(void)
{
PyObject *m, *d;
diff --git a/Python/marshal.c b/Python/marshal.c
index 5aaa3821b4..0bb7b4f69c 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -875,7 +875,7 @@ static PyMethodDef marshal_methods[] = {
{NULL, NULL} /* sentinel */
};
-void
+PyMODINIT_FUNC
PyMarshal_Init(void)
{
(void) Py_InitModule("marshal", marshal_methods);