Proposed patch to be compatible with Python < 2.3

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposed patch to be compatible with Python < 2.3

Mats Bengtsson-6
Hi,

May I submit the following patch? Otherwise we have to increase
the required Python version number to 2.3. Of course, I would then
also add a comment in INSTALL.txt that Python 2.3 is needed for
Mingw and Cygwin.

Index: python/midi.c
===================================================================
RCS file: /cvsroot/lilypond/lilypond/python/midi.c,v
retrieving revision 1.12
diff -p -u -u -r1.12 midi.c
--- python/midi.c       2 Nov 2005 01:47:44 -0000       1.12
+++ python/midi.c       17 Nov 2005 09:59:42 -0000
@@ -20,6 +20,15 @@ midi.parse (s)
 
 #include <Python.h>
 
+/* PyMIDINIT_FUNC isn't defined in Python < 2.3 */
+#ifndef PyMODINIT_FUNC
+#       if defined(__cplusplus)
+#               define PyMODINIT_FUNC extern "C" void
+#       else /* __cplusplus */
+#               define PyMODINIT_FUNC void
+#       endif /* __cplusplus */
+#endif
+
 #if 0
 int x = 0;
 int *track = &x;


   /Mats

--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463
        Fax:   (+46) 8 790 7260
        Email: [hidden email]
        WWW: http://www.s3.kth.se/~mabe
=============================================



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Proposed patch to be compatible with Python < 2.3

Han-Wen Nienhuys
Mats Bengtsson wrote:
> Hi,
>
> May I submit the following patch? Otherwise we have to increase

yes.

> the required Python version number to 2.3. Of course, I would then
> also add a comment in INSTALL.txt that Python 2.3 is needed for
> Mingw and Cygwin.
>

it's very well possible that some components don't work on 2.2 or
earlier.  I recall lots of problems with the re module.


--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel