From: Guido van Rossum Date: Wed, 10 Jan 2001 21:03:32 +0000 (+0000) Subject: Part of SF patch #102409 by jlt63 to support building these modules X-Git-Tag: v2.1a1~345 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a53019b0d4780b270c0c8027e0e66b7183fb661;p=python Part of SF patch #102409 by jlt63 to support building these modules under CYGWIN as shared libraries (DLLs). --- diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 332b2dab55..c567e7b583 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -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; diff --git a/Modules/readline.c b/Modules/readline.c index cf0b064b64..8bb02393d2 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -27,6 +27,9 @@ #else #include /* You may need to add an -I option to Setup */ +#ifdef __CYGWIN__ +#include +#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 */ diff --git a/Modules/rotormodule.c b/Modules/rotormodule.c index 9f58ff2656..cc2592422a 100644 --- a/Modules/rotormodule.c +++ b/Modules/rotormodule.c @@ -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); } diff --git a/Modules/shamodule.c b/Modules/shamodule.c index 8f9523050e..32ac02dbab 100644 --- a/Modules/shamodule.c +++ b/Modules/shamodule.c @@ -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;