[pypy-svn] r7390 - pypy/trunk/src/pypy/translator
mwh at codespeak.net
mwh at codespeak.net
Thu Nov 18 17:39:04 CET 2004
Author: mwh
Date: Thu Nov 18 17:39:03 2004
New Revision: 7390
Modified:
pypy/trunk/src/pypy/translator/genc.h
Log:
Oops, meant to check this in last time!
Modified: pypy/trunk/src/pypy/translator/genc.h
==============================================================================
--- pypy/trunk/src/pypy/translator/genc.h (original)
+++ pypy/trunk/src/pypy/translator/genc.h Thu Nov 18 17:39:03 2004
@@ -72,6 +72,12 @@
#define OP_GETITEM(x,y,r,err) if (!(r=PyObject_GetItem1(x,y))) goto err;
#define OP_SETITEM(x,y,z,r,err) if ((PyObject_SetItem1(x,y,z))<0) goto err; \
r=Py_None; Py_INCREF(r);
+#define OP_CONTAINS(x,y,r,err) switch (PySequence_Contains(x,y)) { \
+ case 1: \
+ Py_INCREF(Py_True); r = Py_True; break; \
+ case 0: \
+ Py_INCREF(Py_False); r = Py_False; break; \
+ default: goto err; }
#define OP_GETATTR(x,y,r,err) if (!(r=PyObject_GetAttr(x,y))) goto err;
#define OP_SETATTR(x,y,z,r,err) if ((PyObject_SetAttr(x,y,z))<0) goto err; \
@@ -169,7 +175,8 @@
#define SETUP_MODULE \
PyGenCFunction_Type.tp_base = &PyCFunction_Type; \
- PyType_Ready(&PyGenCFunction_Type);
+ PyType_Ready(&PyGenCFunction_Type); \
+ PyExc_OperationError = PyErr_NewException("bah.OperationError", NULL, NULL);
/*** operations with a variable number of arguments ***/
@@ -287,6 +294,7 @@
}
#endif
+static PyObject* PyExc_OperationError;
/************************************************************/
/*** The rest is produced by genc.py ***/
More information about the Pypy-commit
mailing list