From 653b4657e67f24339abd18a154a57ca5d578b4b9 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Tue, 7 Feb 2017 15:28:33 +0000 Subject: style: Force Python.h to be included before main header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Nikos Nikoleris Reviewed-by: Jason Lowe-Power Reviewed-by: Pierre-Yves PĂ©neau --- util/style/sort_includes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/style') diff --git a/util/style/sort_includes.py b/util/style/sort_includes.py index 334d9e29e..a35b08468 100644 --- a/util/style/sort_includes.py +++ b/util/style/sort_includes.py @@ -169,8 +169,8 @@ class SortIncludes(object): ) block_order = ( - ('main', ), ('python', ), + ('main', ), ('c', ), ('stl', ), ('cc', ), -- cgit v1.2.3