[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pygame] Pygame patch for 1.5.2
Hello,
Today i made quick patch in order to compile pygame for 1.5.2.
chimp, liquid and stars demo work after converting to old sintax (+= and
*= only).
Is it worth to become part of package?
regards,
Niki Spahiev
Index: pygame.h
===================================================================
RCS file: /home/cvspsrv/cvsroot/games/pygame/src/pygame.h,v
retrieving revision 1.13
diff -r1.13 pygame.h
355a356,394
> #ifndef PyObject_DEL
> /* Some 2.x to 1.5 comaptibility macros */
> #define PyObject_DEL(op) free(op)
>
> #define PyMem_New(type, n) \
> ( (type *) PyMem_Malloc((n) * sizeof(type)) )
> #define PyMem_Del(p) PyMem_Free(p)
>
> static int
> PyModule_AddObject(PyObject *m, char *name, PyObject *o)
> {
> PyObject *dict;
> if (!PyModule_Check(m) || o == NULL)
> return -1;
> dict = PyModule_GetDict(m);
> if (dict == NULL)
> return -1;
> if (PyDict_SetItemString(dict, name, o))
> return -1;
> Py_DECREF(o);
> return 0;
> }
>
> #define PyModule_AddIntConstant(PyObject *m, char *name, long value) \
> PyModule_AddObject(m, name, PyInt_FromLong(value))
>
> #define PySequence_Size PySequence_Length
>
> #define PyString_AsStringAndSize(o,ppc,pn) (*ppc = PyString_AsString(o), *pn = PyString_Size(o))
>
> #define PyUnicode_Check(text) 0
> #define PyUnicode_AsUnicode(text) text
> #define Py_UNICODE void
> #define PyUnicode_FromUnicode(p,c) PyLong_FromLong(*(short*)(p))
> #define PyUnicode_FromObject(s) s
>
> // transform.c uses ceil()
> #include <math.h>
> #endif