Commit c26ff41d authored by Christian Tismer's avatar Christian Tismer

Generalized my type flags structure extension without being specific about

the purpose. Increased my claim to two bits, hoping that nobody
will complain about it. I'm taking the highest two bits, whatever
the integer word size may be.
parent c316d0d3
...@@ -488,11 +488,11 @@ given type object has a specified feature. ...@@ -488,11 +488,11 @@ given type object has a specified feature.
/* Objects support garbage collection (see objimp.h) */ /* Objects support garbage collection (see objimp.h) */
#define Py_TPFLAGS_HAVE_GC (1L<<14) #define Py_TPFLAGS_HAVE_GC (1L<<14)
/* Objects support special, non-recursive calls (reserved for Stackless) */ /* These last two bits are preserved for Stackless Python */
#ifdef STACKLESS #ifdef STACKLESS
#define Py_TPFLAGS_HAVE_NR_THINGS (1L<<31) #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION (3L<<(sizeof(int)*8-2))
#else #else
#define Py_TPFLAGS_HAVE_NR_THINGS 0 #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION 0
#endif #endif
#define Py_TPFLAGS_DEFAULT ( \ #define Py_TPFLAGS_DEFAULT ( \
...@@ -503,7 +503,7 @@ given type object has a specified feature. ...@@ -503,7 +503,7 @@ given type object has a specified feature.
Py_TPFLAGS_HAVE_WEAKREFS | \ Py_TPFLAGS_HAVE_WEAKREFS | \
Py_TPFLAGS_HAVE_ITER | \ Py_TPFLAGS_HAVE_ITER | \
Py_TPFLAGS_HAVE_CLASS | \ Py_TPFLAGS_HAVE_CLASS | \
Py_TPFLAGS_HAVE_NR_THINGS | \ Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | \
0) 0)
#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment