diff options
author | Olly Betts <olly@survex.com> | 2013-08-24 08:34:50 +1200 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2013-08-24 08:34:50 +1200 |
commit | b477cb66be5739a0acc2c2de15e988187971ce40 (patch) | |
tree | 844c7abf819530177e1b781fdce09235a72b0c6b | |
parent | a495b5a985ca54033cfea6719d4d838c85b9c2aa (diff) | |
download | swig-b477cb66be5739a0acc2c2de15e988187971ce40.tar.gz |
Use offsetof() rather than icky homemade equivalent
-rw-r--r-- | Source/Modules/python.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 7ee4ae225..233f79bd6 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -3401,7 +3401,7 @@ public: printSlot(f, getSlot(n, "feature:python:tp_dict"), "tp_dict"); printSlot(f, getSlot(n, "feature:python:tp_descr_get"), "tp_descr_get", "descrgetfunc"); printSlot(f, getSlot(n, "feature:python:tp_descr_set"), "tp_descr_set", "descrsetfunc"); - Printf(f, " (size_t)(((char*)&((SwigPyObject *) 64L)->dict) - (char*) 64L), /* tp_dictoffset */\n"); + Printf(f, " offsetof(SwigPyObject, dict), /* tp_dictoffset */\n"); printSlot(f, tp_init, "tp_init", "initproc"); printSlot(f, getSlot(n, "feature:python:tp_alloc"), "tp_alloc", "allocfunc"); printSlot(f, "0", "tp_new", "newfunc"); |