From: Stefan Behnel Date: Sat, 25 Oct 2008 13:59:38 +0000 (+0200) Subject: fixed stupid mistake from cleaning up Lisandros patch X-Git-Tag: 0.9.9.2.beta~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6ab8a67a585de6f746785477a17c296d9f7d77a5;p=cython.git fixed stupid mistake from cleaning up Lisandros patch --- diff --git a/Cython/Compiler/Builtin.py b/Cython/Compiler/Builtin.py index 2b9136aa..c00c49fd 100644 --- a/Cython/Compiler/Builtin.py +++ b/Cython/Compiler/Builtin.py @@ -173,13 +173,13 @@ proto = """ #if PY_VERSION_HEX < 0x02050000 #ifndef PyAnySet_CheckExact -#define PyAnySet_CheckExact(ob) \ - ((ob)->ob_type == ((PyTypeObject*)&PySet_Type) || \ - (ob)->ob_type == ((PyTypeObject*)&PyFrozenSet_Type)) +#define PyAnySet_CheckExact(ob) \\ + ((ob)->ob_type == &PySet_Type || \\ + (ob)->ob_type == &PyFrozenSet_Type) -#define PySet_New(iterable) \ +#define PySet_New(iterable) \\ PyObject_CallFunctionObjArgs((PyObject *)PySet_Type, iterable, NULL) -#define Pyx_PyFrozenSet_New(iterable) \ +#define Pyx_PyFrozenSet_New(iterable) \\ PyObject_CallFunctionObjArgs((PyObject *)PyFrozenSet_Type, iterable, NULL) #define PySet_Size(anyset) PyObject_Size(anyset) @@ -210,12 +210,15 @@ static INLINE int PySet_Add(PyObject *set, PyObject *key) { #ifndef Py_SETOBJECT_H #define Py_SETOBJECT_H -static PyTypeObject *PySet_Type = NULL; -static PyTypeObject *PyFrozenSet_Type = NULL; +static PyTypeObject *__Pyx_PySet_Type = NULL; +static PyTypeObject *__Pyx_PyFrozenSet_Type = NULL; -#define PyAnySet_Check(ob) \ - (PyAnySet_CheckExact(ob) || \ - PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \ +#define PySet_Type (*__Pyx_PySet_Type) +#define PyFrozenSet_Type (*__Pyx_PyFrozenSet_Type) + +#define PyAnySet_Check(ob) \\ + (PyAnySet_CheckExact(ob) || \\ + PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \\ PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type)) #define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type) @@ -233,8 +236,8 @@ static int __Pyx_Py23SetsImport(void) { if (!ImmutableSet) goto bad; Py_DECREF(sets); - PySet_Type = (PyTypeObject*) Set; - PyFrozenSet_Type = (PyTypeObject*) ImmutableSet; + __Pyx_PySet_Type = (PyTypeObject*) Set; + __Pyx_PyFrozenSet_Type = (PyTypeObject*) ImmutableSet; /* FIXME: this should be done in dedicated module cleanup code */ /*