[Python-checkins] cpython: Issue #23685: Fix usage of PyMODINIT_FUNC in _json, _scproxy, nis, pyexpat

victor.stinner python-checkins at python.org
Tue Mar 17 17:53:24 CET 2015


https://hg.python.org/cpython/rev/22a0c925a7c2
changeset:   95020:22a0c925a7c2
parent:      95017:c89f7c34e356
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Mar 17 17:48:27 2015 +0100
summary:
  Issue #23685: Fix usage of PyMODINIT_FUNC in _json, _scproxy, nis, pyexpat
_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.

files:
  Modules/_json.c               |   2 +-
  Modules/_scproxy.c            |   2 +-
  Modules/cjkcodecs/cjkcodecs.h |   2 +-
  Modules/nismodule.c           |   4 ++--
  Modules/pyexpat.c             |  10 ----------
  5 files changed, 5 insertions(+), 15 deletions(-)


diff --git a/Modules/_json.c b/Modules/_json.c
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -1995,7 +1995,7 @@
         NULL
 };
 
-PyObject*
+PyMODINIT_FUNC
 PyInit__json(void)
 {
     PyObject *m = PyModule_Create(&jsonmodule);
diff --git a/Modules/_scproxy.c b/Modules/_scproxy.c
--- a/Modules/_scproxy.c
+++ b/Modules/_scproxy.c
@@ -249,7 +249,7 @@
 extern "C" {
 #endif
 
-PyObject*
+PyMODINIT_FUNC
 PyInit__scproxy(void)
 {
     return PyModule_Create(&mod_module);
diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -401,7 +401,7 @@
         NULL,                                                           \
         NULL                                                            \
     };                                                                  \
-    PyObject*                                                           \
+    PyMODINIT_FUNC                                                      \
     PyInit__codecs_##loc(void)                                          \
     {                                                                   \
         PyObject *m = PyModule_Create(&__module);                       \
diff --git a/Modules/nismodule.c b/Modules/nismodule.c
--- a/Modules/nismodule.c
+++ b/Modules/nismodule.c
@@ -456,8 +456,8 @@
     NULL
 };
 
-PyObject*
-PyInit_nis (void)
+PyMODINIT_FUNC
+PyInit_nis(void)
 {
     PyObject *m, *d;
     m = PyModule_Create(&nismodule);
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -1900,16 +1900,6 @@
 #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,

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list