summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2013-08-24 08:34:50 +1200
committerOlly Betts <olly@survex.com>2013-08-24 08:34:50 +1200
commitb477cb66be5739a0acc2c2de15e988187971ce40 (patch)
tree844c7abf819530177e1b781fdce09235a72b0c6b
parenta495b5a985ca54033cfea6719d4d838c85b9c2aa (diff)
downloadswig-b477cb66be5739a0acc2c2de15e988187971ce40.tar.gz
Use offsetof() rather than icky homemade equivalent
-rw-r--r--Source/Modules/python.cxx2
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");