]> granicus.if.org Git - python/commitdiff
Bug #794140: cygwin builds do not embed
authorJason Tishler <jason@tishler.net>
Thu, 4 Sep 2003 11:59:50 +0000 (11:59 +0000)
committerJason Tishler <jason@tishler.net>
Thu, 4 Sep 2003 11:59:50 +0000 (11:59 +0000)
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).

Include/pyport.h
Modules/gcmodule.c
Python/import.c
Python/marshal.c

index 06ce6ab56b2a6decdb5aa6c7a6c75eea6ea28e27..8747271cf295778d76030cf7ea5db3f25c971029 100644 (file)
@@ -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 */
index bb40b8f9c7c1001cbd71936c92a2713d24226cf1..6442fe5452a24763138f69a30146191a52258289 100644 (file)
@@ -951,7 +951,7 @@ static PyMethodDef GcMethods[] = {
        {NULL,  NULL}           /* Sentinel */
 };
 
-void
+PyMODINIT_FUNC
 initgc(void)
 {
        PyObject *m;
index 858f9e57c41f373adc15ce7b76f54a84416cf08c..abe3a1907db6fbd4db1296a82a337be8ea2bd735 100644 (file)
@@ -2841,7 +2841,7 @@ setint(PyObject *d, char *name, int value)
        return err;
 }
 
-void
+PyMODINIT_FUNC
 initimp(void)
 {
        PyObject *m, *d;
index 5aaa3821b42cf7a01f737bdc47d47ee87f2c6393..0bb7b4f69cddf1118f41b8270087c406f7e77cb6 100644 (file)
@@ -875,7 +875,7 @@ static PyMethodDef marshal_methods[] = {
        {NULL,          NULL}           /* sentinel */
 };
 
-void
+PyMODINIT_FUNC
 PyMarshal_Init(void)
 {
        (void) Py_InitModule("marshal", marshal_methods);