summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2017-02-07 15:28:33 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-02-07 15:28:33 +0000
commit653b4657e67f24339abd18a154a57ca5d578b4b9 (patch)
treec5ed13b206407654e7205ec4433cbd58847e682a /src/sim
parent227bdde922e919771e8702fc422461df4f1d317d (diff)
downloadgem5-653b4657e67f24339abd18a154a57ca5d578b4b9.tar.xz
style: Force Python.h to be included before main header
Python's header files set various compiler macros (e.g., _XOPEN_SOURCE) unconditionally. This triggers preprocessor warnings that end up being treated as errors. The Python integration manual [1] strongly recommends that Python.h is included before any system header. The style guide used to mandate that Python.h is included first in any file that needs it. 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. [1] https://docs.python.org/2/extending/extending.html Change-Id: Id6a4f7fc64a336a8fd26691a0ca682abeb1d1579 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Pierre-Yves PĂ©neau <pierre-yves.peneau@lirmm.fr>
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/init.cc4
-rw-r--r--src/sim/py_interact.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/sim/init.cc b/src/sim/init.cc
index d46e76324..f2395eec4 100644
--- a/src/sim/init.cc
+++ b/src/sim/init.cc
@@ -41,10 +41,10 @@
* Authors: Nathan Binkert
*/
-#include "sim/init.hh"
-
#include <Python.h>
+#include "sim/init.hh"
+
#include <marshal.h>
#include <zlib.h>
diff --git a/src/sim/py_interact.cc b/src/sim/py_interact.cc
index 8acff40dd..7e6527e81 100644
--- a/src/sim/py_interact.cc
+++ b/src/sim/py_interact.cc
@@ -29,10 +29,10 @@
* Steve Reinhardt
*/
-#include "sim/py_interact.hh"
-
#include <Python.h>
+#include "sim/py_interact.hh"
+
void
py_interact()
{