Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 740
    • Issues 740
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 195
    • Merge requests 195
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Merge requests
  • !1582

Add #include for offsetof() macro in generated Python wrappers

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Max Smolens requested to merge msmolens/vtk:python-wrapping-include-cstddef into master Jun 20, 2016
  • Overview 7
  • Commits 1
  • Changes 1

The generated Python wrappers use the C offsetof() macro, but don't #include the header that defines the macro (). 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 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_weaklistoffset
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: python-wrapping-include-cstddef