[KoCo-CVS] [Commit] iconvcodec THANKS _iconv_codec.c _iconv_codec_compat.h
Brought to you by:
perky
From: Hye-Shik C. <pe...@us...> - 2003-06-12 04:11:21
|
perky 03/06/11 21:11:20 Modified: . THANKS _iconv_codec.c _iconv_codec_compat.h Log: Add a workaround for mingw32 compilation. Submitted by: Young-Sik Won <mon...@dr...> Revision Changes Path 1.2 +1 -0 iconvcodec/THANKS Index: THANKS =================================================================== RCS file: /cvsroot/koco/iconvcodec/THANKS,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- THANKS 11 Jun 2003 05:52:50 -0000 1.1 +++ THANKS 12 Jun 2003 04:11:19 -0000 1.2 @@ -1 +1,2 @@ Changwoo Ryu <cw...@de...> reported a bugfix +Young-Sik Won <mon...@dr...> compilation fix on mingw32 1.13 +13 -69 iconvcodec/_iconv_codec.c Index: _iconv_codec.c =================================================================== RCS file: /cvsroot/koco/iconvcodec/_iconv_codec.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- _iconv_codec.c 11 Jun 2003 12:40:13 -0000 1.12 +++ _iconv_codec.c 12 Jun 2003 04:11:19 -0000 1.13 @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _iconv_codec.c,v 1.12 2003/06/11 12:40:13 perky Exp $ + * $Id: _iconv_codec.c,v 1.13 2003/06/12 04:11:19 perky Exp $ */ #include "Python.h" @@ -757,13 +757,7 @@ {NULL, NULL}, }; -#ifdef OLD_STYLE_TYPE -static PyObject * -iconvencoder_getattr(PyObject *self, char *name) -{ - return Py_FindMethod(iconvencoder_methods, self, name); -} -#endif +OLD_GETATTR_DEF(iconvencoder) static void iconvencoder_dealloc(IconvEncoderObject *self) @@ -794,11 +788,7 @@ /* methods */ (destructor)iconvencoder_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ -#ifdef OLD_STYLE_TYPE - iconvencoder_getattr, /*tp_getattr*/ -#else - 0, /*tp_getattr*/ -#endif + GETATTR_FUNC(iconvencoder), /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ #ifndef LACKS_PYSTRING_FROMFORMAT @@ -812,11 +802,7 @@ 0, /*tp_hash*/ (ternaryfunc)iconvencoder_call, /*tp_call*/ 0, /*tp_str*/ -#ifdef OLD_STYLE_TYPE - 0, /*tp_getattro*/ -#else - PyObject_GenericGetAttr, /*tp_getattro*/ -#endif + GETATTRO_FUNC, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT, /*tp_flags*/ @@ -1275,13 +1261,7 @@ {NULL, NULL}, }; -#ifdef OLD_STYLE_TYPE -static PyObject * -iconvdecoder_getattr(PyObject *self, char *name) -{ - return Py_FindMethod(iconvdecoder_methods, self, name); -} -#endif +OLD_GETATTR_DEF(iconvdecoder) static void iconvdecoder_dealloc(IconvDecoderObject *self) @@ -1312,11 +1292,7 @@ /* methods */ (destructor)iconvdecoder_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ -#ifdef OLD_STYLE_TYPE - iconvdecoder_getattr, /*tp_getattr*/ -#else - 0, /*tp_getattr*/ -#endif + GETATTR_FUNC(iconvdecoder), /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ #ifndef LACKS_PYSTRING_FROMFORMAT @@ -1330,11 +1306,7 @@ 0, /*tp_hash*/ (ternaryfunc)iconvdecoder_call, /*tp_call*/ 0, /*tp_str*/ -#ifdef OLD_STYLE_TYPE - 0, /*tp_getattro*/ -#else - PyObject_GenericGetAttr, /*tp_getattro*/ -#endif + GETATTRO_FUNC, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT, /*tp_flags*/ @@ -1555,13 +1527,7 @@ {NULL, NULL}, }; -#ifdef OLD_STYLE_TYPE -static PyObject * -iconvstreamreader_getattr(PyObject *self, char *name) -{ - return Py_FindMethod(iconvstreamreader_methods, self, name); -} -#endif +OLD_GETATTR_DEF(iconvstreamreader) static void iconvstreamreader_dealloc(IconvStreamReaderObject *self) @@ -1597,11 +1563,7 @@ /* methods */ (destructor)iconvstreamreader_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ -#ifdef OLD_STYLE_TYPE - iconvstreamreader_getattr, /*tp_getattr*/ -#else - 0, /*tp_getattr*/ -#endif + GETATTR_FUNC(iconvstreamreader),/*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ #ifndef LACKS_PYSTRING_FROMFORMAT @@ -1615,11 +1577,7 @@ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ -#ifdef OLD_STYLE_TYPE - 0, /*tp_getattro*/ -#else - PyObject_GenericGetAttr, /*tp_getattro*/ -#endif + GETATTRO_FUNC, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT, /*tp_flags*/ @@ -1754,13 +1712,7 @@ {NULL, NULL}, }; -#ifdef OLD_STYLE_TYPE -static PyObject * -iconvstreamwriter_getattr(PyObject *self, char *name) -{ - return Py_FindMethod(iconvstreamwriter_methods, self, name); -} -#endif +OLD_GETATTR_DEF(iconvstreamwriter) static void iconvstreamwriter_dealloc(IconvStreamWriterObject *self) @@ -1796,11 +1748,7 @@ /* methods */ (destructor)iconvstreamwriter_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ -#ifdef OLD_STYLE_TYPE - iconvstreamwriter_getattr, /*tp_getattr*/ -#else - 0, /*tp_getattr*/ -#endif + GETATTR_FUNC(iconvstreamwriter),/*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ #ifndef LACKS_PYSTRING_FROMFORMAT @@ -1814,11 +1762,7 @@ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ -#ifdef OLD_STYLE_TYPE - 0, /*tp_getattro*/ -#else - PyObject_GenericGetAttr, /*tp_getattro*/ -#endif + GETATTRO_FUNC, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT, /*tp_flags*/ 1.3 +23 -1 iconvcodec/_iconv_codec_compat.h Index: _iconv_codec_compat.h =================================================================== RCS file: /cvsroot/koco/iconvcodec/_iconv_codec_compat.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- _iconv_codec_compat.h 20 Apr 2003 20:45:34 -0000 1.2 +++ _iconv_codec_compat.h 12 Jun 2003 04:11:19 -0000 1.3 @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: _iconv_codec_compat.h,v 1.2 2003/04/20 20:45:34 perky Exp $ + * $Id: _iconv_codec_compat.h,v 1.3 2003/06/12 04:11:19 perky Exp $ */ /* We don't support 2.0 and older */ @@ -51,7 +51,29 @@ # define LACKS_PYSTRING_FROMFORMAT 1 # define OLD_STYLE_TYPE 1 # define METH_NOARGS METH_VARARGS +# define OLD_GETATTR_DEF(prefix) \ + static PyObject * \ + prefix##_getattr(PyObject *self, char *name) \ + { \ + return Py_FindMethod(prefix##_methods, self, name); \ + } +# define GETATTR_FUNC(prefix) prefix##_getattr +# define GETATTRO_FUNC 0 +#else +# define OLD_GETATTR_DEF(prefix) +# define GETATTR_FUNC(prefix) 0 +# ifdef __MINGW32__ +__inline static PyObject* __dummy_getattro(PyObject* self, PyObject* args) +{ + return PyObject_GenericGetAttr(self, args); +} +# define GETATTRO_FUNC __dummy_getattro +# else +# define GETATTRO_FUNC PyObject_GenericGetAttr +# endif #endif + + /* * ex: ts=8 sts=4 et |