COMP: Resolve DCMTK/Python macro redefs in AUTOGEN mocs TU; prevent Windows pid_t clash #1273
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AUTOMOC merges all
moc_*.cppinto one Translation Unit (TU) (<target>_autogen/mocs_compilation*.cpp). For CTKDICOMWidgets, that TU ends up including bothPython.h(via PythonQt) and DCMTK's osconfig.h. Across platforms,pyconfig.handosconfig.hdefine overlappingHAVE_*feature macros; when merged, this yields widespread redefinition warnings.On Windows,
pyconfig.hmay also typedefpid_t, colliding with DCMTK’s typedef and causing MSVC C2632 ("int followed by int is illegal"). On Unix-like systems,pid_tcomes from<sys/types.h>, so the type clash does not escalate.Fix:
PythonQtPythonInclude.hfirst in the generated wrapper header.#undefa minimal set of Python-definedHAVE_*macros so DCMTK can (re)define them without conflict, restoring the effective isolation we had before enabling AUTOMOC.Behavior is unchanged; this quiets warnings cross-platform and prevents the Windows build error.