Commit a0eb686
committed
Add #include for offsetof() macro in generated Python wrappers
The generated Python wrappers use the C offsetof() macro, but don't #include the
header that defines the macro (<cstddef>). For example, see
https://gitlab.kitware.com/vtk/vtk/blob/636aa17/Wrapping/Tools/vtkWrapPythonClass.c#L553.
This commit adds the proper header to the generated Python wrappers. Without
this, wrapping could fail unless <cstddef> is indirectly included through the
header of the class being wrapped. An example error message is:
Libs/MRML/Core/vtkMRMLSubjectHierarchyConstantsPython.cxx:853:40: error: ‘offsetof’ was not declared in this scope
offsetof(PyVTKObject, vtk_weakreflist), // tp_weaklistoffset1 parent 636aa17 commit a0eb686
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| 388 | + | |
388 | 389 | | |
389 | 390 | | |
390 | 391 | | |
| |||
0 commit comments