]> granicus.if.org Git - python/commitdiff
Issue #23685: Fix usage of PyMODINIT_FUNC in _json, _scproxy, nis, pyexpat
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 17 Mar 2015 16:48:27 +0000 (17:48 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 17 Mar 2015 16:48:27 +0000 (17:48 +0100)
_codecs_cn, _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr and _codecs_tw
modules.

pyexpat.c doesn't need to redeclare PyMODINIT_FUNC, it's already declared in
Include/pyport.h.

Modules/_json.c
Modules/_scproxy.c
Modules/cjkcodecs/cjkcodecs.h
Modules/nismodule.c
Modules/pyexpat.c

index 076859f99cd93bf13c59935137790882703f77a8..3a60243256288f55230c6cecb1f4fdac6c675dc1 100644 (file)
@@ -1995,7 +1995,7 @@ static struct PyModuleDef jsonmodule = {
         NULL
 };
 
-PyObject*
+PyMODINIT_FUNC
 PyInit__json(void)
 {
     PyObject *m = PyModule_Create(&jsonmodule);
index 3b2a38ea32faae53590f4c13adbd61f0daaa6efb..66b6e3439f2098d72656a7568d0ae43d9e8509a3 100644 (file)
@@ -249,7 +249,7 @@ static struct PyModuleDef mod_module = {
 extern "C" {
 #endif
 
-PyObject*
+PyMODINIT_FUNC
 PyInit__scproxy(void)
 {
     return PyModule_Create(&mod_module);
index a45ed125fa80ade8f0923641700891d1730a36f9..23642df9aff9e818713d38c49af679af07d2c039 100644 (file)
@@ -401,7 +401,7 @@ errorexit:
         NULL,                                                           \
         NULL                                                            \
     };                                                                  \
-    PyObject*                                                           \
+    PyMODINIT_FUNC                                                      \
     PyInit__codecs_##loc(void)                                          \
     {                                                                   \
         PyObject *m = PyModule_Create(&__module);                       \
index 0af495fa538cacae4e4e2c6d26a5e2c5a29fd05e..64eb5dbc3d0299667ead6b9f6e0805fbc1fa2ca9 100644 (file)
@@ -456,8 +456,8 @@ static struct PyModuleDef nismodule = {
     NULL
 };
 
-PyObject*
-PyInit_nis (void)
+PyMODINIT_FUNC
+PyInit_nis(void)
 {
     PyObject *m, *d;
     m = PyModule_Create(&nismodule);
index 21cb04a8260761b380af44fdc5ed7e0d4dde6d78..ce6535449746caf49a183810e70728d909436d45 100644 (file)
@@ -1900,16 +1900,6 @@ PyDoc_STRVAR(pyexpat_module_documentation,
 #define MODULE_INITFUNC PyInit_pyexpat
 #endif
 
-#ifndef PyMODINIT_FUNC
-#   ifdef MS_WINDOWS
-#       define PyMODINIT_FUNC __declspec(dllexport) void
-#   else
-#       define PyMODINIT_FUNC void
-#   endif
-#endif
-
-PyMODINIT_FUNC MODULE_INITFUNC(void);  /* avoid compiler warnings */
-
 static struct PyModuleDef pyexpatmodule = {
         PyModuleDef_HEAD_INIT,
         MODULE_NAME,