systemc: Push python headers on top of sources
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 9 Nov 2018 09:18:13 +0000 (09:18 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Mon, 12 Nov 2018 23:30:22 +0000 (23:30 +0000)
Some build failures has been seen after USE_SYSTEMC being True by
default and that has been caused by double definition of _XOPEN_SOURCE
and _POSIX_C_SOURCE in some python versions (like 2.7.5, 2.7.13) and
/usr/include/features.h (used by gcc)

Python definition should preceed features.h one, since the latter will
manually #undef them before #define them.

Change-Id: I774711aaf8145df9ad7677a393a60cf3662d6816
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/14095
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/sc_main_python.cc

index 66fae58bba3731e3a1c960cc2113a016e0589608..60d57b47872961c67cc85ef53c09c12f7458029e 100644 (file)
  * Authors: Gabe Black
  */
 
+// This should be on top since it is including python headers
+#include "systemc/core/python.hh"
+
 #include <cstring>
 #include <string>
 
 #include "base/fiber.hh"
 #include "base/logging.hh"
-#include "systemc/core/python.hh"
 #include "systemc/core/sc_main_fiber.hh"
 
 namespace