chiark
/
gitweb
/
~mdw
/
pyke
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
138563a
)
pyke/pyke.h: Add a `MEMBER' variant with explicit member name.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 20 Oct 2019 11:43:40 +0000
(12:43 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sat, 11 Apr 2020 11:44:14 +0000
(12:44 +0100)
pyke.h
patch
|
blob
|
blame
|
history
diff --git
a/pyke.h
b/pyke.h
index e7a1ece6d8364da04a1f7269f3be3da4f89789b3..3076bb5f98db12b871f273a5fb050de7ba68dbfa 100644
(file)
--- a/
pyke.h
+++ b/
pyke.h
@@
-271,15
+271,16
@@
extern PyTypeObject *inittype(PyTypeObject */*skel*/,
#define GETSET(func, doc) \
{ #func, GETSETNAME(get, func), GETSETNAME(set, func), doc },
#define GETSET(func, doc) \
{ #func, GETSETNAME(get, func), GETSETNAME(set, func), doc },
-/* Convenience wrapper for filling in `PyMemberDef' tables. Define
+/* Convenience wrapper
s
for filling in `PyMemberDef' tables. Define
* `MEMBERSTRUCT' locally as
*
* #define MEMBERSTRUCT foo_pyobj
*
* around the member table.
*/
* `MEMBERSTRUCT' locally as
*
* #define MEMBERSTRUCT foo_pyobj
*
* around the member table.
*/
-#define MEMBER(name, ty, f, doc) \
- { #name, ty, offsetof(MEMBERSTRUCT, name), f, doc },
+#define MEMRNM(name, ty, mem, f, doc) \
+ { #name, ty, offsetof(MEMBERSTRUCT, mem), f, doc },
+#define MEMBER(name, ty, f, doc) MEMRNM(name, ty, name, f, doc)
/* Wrappers for filling in pointers in a `PyTypeObject' structure, (a)
* following Pyke naming convention, and (b) stripping `const' from the types
/* Wrappers for filling in pointers in a `PyTypeObject' structure, (a)
* following Pyke naming convention, and (b) stripping `const' from the types