@@ -524,12 +524,12 @@ extern char * _getpty(int *, int, mode_t, int);
524
524
*/
525
525
526
526
/*
527
- All windows ports, except cygwin, are handled in PC/pyconfig.h.
527
+ Only MSVC windows ports is handled in PC/pyconfig.h.
528
528
529
- Cygwin is the only other autoconf platform requiring special
529
+ Cygwin and Mingw is the only other autoconf platform requiring special
530
530
linkage handling and it uses __declspec().
531
531
*/
532
- #if defined(__CYGWIN__)
532
+ #if defined(__CYGWIN__) || defined(__MINGW32__)
533
533
# define HAVE_DECLSPEC_DLL
534
534
#endif
535
535
@@ -542,21 +542,23 @@ extern char * _getpty(int *, int, mode_t, int);
542
542
# define PyAPI_FUNC (RTYPE ) Py_EXPORTED_SYMBOL RTYPE
543
543
# define PyAPI_DATA (RTYPE ) extern Py_EXPORTED_SYMBOL RTYPE
544
544
/* module init functions inside the core need no external linkage */
545
- /* except for Cygwin to handle embedding */
546
- # if defined(__CYGWIN__)
545
+ /* except for Cygwin/Mingw to handle embedding */
546
+ # if defined(__CYGWIN__) || defined(__MINGW32__)
547
547
# define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
548
- # else /* __CYGWIN__ */
548
+ # else /* __CYGWIN__ || __MINGW32__ */
549
549
# define PyMODINIT_FUNC PyObject*
550
- # endif /* __CYGWIN__ */
550
+ # endif /* __CYGWIN__ || __MINGW32__ */
551
551
# else /* Py_BUILD_CORE */
552
552
/* Building an extension module, or an embedded situation */
553
553
/* public Python functions and data are imported */
554
554
/* Under Cygwin, auto-import functions to prevent compilation */
555
555
/* failures similar to those described at the bottom of 4.1: */
556
556
/* http://docs.python.org/extending/windows.html#a-cookbook-approach */
557
- # if !defined(__CYGWIN__)
557
+ # if defined(__CYGWIN__) || defined(__MINGW32__)
558
+ # define PyAPI_FUNC (RTYPE ) RTYPE
559
+ # else
558
560
# define PyAPI_FUNC (RTYPE ) Py_IMPORTED_SYMBOL RTYPE
559
- # endif /* ! __CYGWIN__ */
561
+ # endif /* __CYGWIN__ || __MINGW32__ */
560
562
# define PyAPI_DATA (RTYPE ) extern Py_IMPORTED_SYMBOL RTYPE
561
563
/* module init functions outside the core must be exported */
562
564
# if defined(__cplusplus)
0 commit comments