]> granicus.if.org Git - python/commitdiff
Part of SF patch #102409 by jlt63 to support building these modules
authorGuido van Rossum <guido@python.org>
Wed, 10 Jan 2001 21:03:32 +0000 (21:03 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 10 Jan 2001 21:03:32 +0000 (21:03 +0000)
under CYGWIN as shared libraries (DLLs).

Modules/mmapmodule.c
Modules/readline.c
Modules/rotormodule.c
Modules/shamodule.c

index 332b2dab55297f8dea3cd8db24ff80a73982dffe..c567e7b583008a1db40401e95333e9ab2a295a77 100644 (file)
@@ -952,13 +952,7 @@ static struct PyMethodDef mmap_functions[] = {
        {NULL,          NULL}        /* Sentinel */
 };
 
-#ifdef MS_WIN32
-__declspec(dllexport) void
-#endif /* MS_WIN32 */
-#ifdef UNIX
-extern void
-#endif
-
+DL_EXPORT(void)
 initmmap(void)
 {
        PyObject *dict, *module;
index cf0b064b64ef1815f3d688a6db34d3d67c7a9635..8bb02393d2274850a9db92fdf008c9c625331228 100644 (file)
@@ -27,6 +27,9 @@
 #else
 #include <readline/readline.h> /* You may need to add an -I option to Setup */
 
+#ifdef __CYGWIN__
+#include <readline/history.h>
+#else /* !__CYGWIN__ */
 extern int rl_parse_and_bind(char *);
 extern int rl_read_init_file(char *);
 extern int rl_insert_text(char *);
@@ -38,11 +41,12 @@ extern int read_history(char *);
 extern int write_history(char *);
 extern int history_truncate_file(char *, int);
 extern Function *rl_event_hook;
+#endif /* !__CYGWIN__ */
 #endif
 
 /* Pointers needed from outside (but not declared in a header file). */
-extern int (*PyOS_InputHook)(void);
-extern char *(*PyOS_ReadlineFunctionPointer)(char *);
+extern DL_IMPORT(int) (*PyOS_InputHook)(void);
+extern DL_IMPORT(char) *(*PyOS_ReadlineFunctionPointer)(char *);
 
 
 /* Exported function to send one line to readline's init file parser */
index 9f58ff26564c5386ea4d0070293566f849c7f9f0..cc2592422ac908ec2098cf4c747e53f2ad5a2de5 100644 (file)
@@ -576,7 +576,7 @@ rotorobj_getattr(Rotorobj *s, char *name)
 
 
 statichere PyTypeObject Rotor_Type = {
-       PyObject_HEAD_INIT(&PyType_Type)
+       PyObject_HEAD_INIT(NULL)
        0,                              /*ob_size*/
        "rotor",                        /*tp_name*/
        sizeof(Rotorobj),               /*tp_size*/
@@ -619,5 +619,6 @@ rotor_methods[] = {
 DL_EXPORT(void)
 initrotor(void)
 {
+       Rotor_Type.ob_type = &PyType_Type;
        (void)Py_InitModule("rotor", rotor_methods);
 }
index 8f9523050e4f9672c95373f3dbc2644636d9e44e..32ac02dbabee40a7b9ceb063b08dbdd5353c08ee 100644 (file)
@@ -529,7 +529,7 @@ static struct PyMethodDef SHA_functions[] = {
        if (o!=NULL) PyDict_SetItemString(d,n,o); \
        Py_XDECREF(o); }
 
-void
+DL_EXPORT(void)
 initsha(void)
 {
     PyObject *d, *m;