[pypy-commit] pypy default: cpyext: declare the RESTRICTED constants for struct members,
amauryfa
noreply at buildbot.pypy.org
Tue Feb 14 22:41:46 CET 2012
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch:
Changeset: r52484:8dd2cfbcc2f7
Date: 2012-02-14 21:48 +0100
http://bitbucket.org/pypy/pypy/changeset/8dd2cfbcc2f7/
Log: cpyext: declare the RESTRICTED constants for struct members, even if
pypy does not implement this at all it seems.
diff --git a/pypy/module/cpyext/include/structmember.h b/pypy/module/cpyext/include/structmember.h
--- a/pypy/module/cpyext/include/structmember.h
+++ b/pypy/module/cpyext/include/structmember.h
@@ -20,7 +20,7 @@
} PyMemberDef;
-/* Types */
+/* Types. These constants are also in structmemberdefs.py. */
#define T_SHORT 0
#define T_INT 1
#define T_LONG 2
@@ -42,9 +42,12 @@
#define T_LONGLONG 17
#define T_ULONGLONG 18
-/* Flags */
+/* Flags. These constants are also in structmemberdefs.py. */
#define READONLY 1
#define RO READONLY /* Shorthand */
+#define READ_RESTRICTED 2
+#define PY_WRITE_RESTRICTED 4
+#define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED)
#ifdef __cplusplus
diff --git a/pypy/module/cpyext/structmemberdefs.py b/pypy/module/cpyext/structmemberdefs.py
--- a/pypy/module/cpyext/structmemberdefs.py
+++ b/pypy/module/cpyext/structmemberdefs.py
@@ -1,3 +1,5 @@
+# These constants are also in include/structmember.h
+
T_SHORT = 0
T_INT = 1
T_LONG = 2
@@ -18,3 +20,6 @@
T_ULONGLONG = 18
READONLY = RO = 1
+READ_RESTRICTED = 2
+WRITE_RESTRICTED = 4
+RESTRICTED = READ_RESTRICTED | WRITE_RESTRICTED
More information about the pypy-commit
mailing list