style: Force Python.h to be included before main header
Review Request #3794 - Created Jan. 27, 2017 and submitted
| Information | |
|---|---|
| Andreas Sandberg | |
| gem5 | |
| default | |
| Reviewers | |
| Default | |
Changeset 11803:1dba09aeeefd
---------------------------
style: Force Python.h to be included before main headerPython's header files set various compiler macros (e.g.,
_XOPEN_SOURCE) unconditionally. This triggers preprocessor warnings
that end up being treated as errors. The style guide used to mandate
that Python headers are included before any other header. This
requirement was changed to always include a source file's main header
first, which ended up triggering these errors.This change updates the style checker to always include Python.h
before the main header file.Change-Id: Id6a4f7fc64a336a8fd26691a0ca682abeb1d1579
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Oops. I should have included this in my description of http://reviews.gem5.org/r/3792/. I think another solution is to include Python.h in src/python/swig/pyevent.hh. See my change in http://reviews.gem5.org/r/3792/diff/1/#33.
If my fix does work, I think it's better to just include Python.h there instead of changing the style.
Ship It!
Update the commit message with a link to the python manual?
