From: Andreas Sandberg Date: Tue, 2 May 2017 13:04:44 +0000 (+0100) Subject: style: Treat PyBind headers as Python headers X-Git-Tag: v19.0.0.0~2810 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=20e221c9c9d4fb4314af062f062a196fafdbb515;p=gem5.git style: Treat PyBind headers as Python headers Some PyBind11 headers need to include Python.h. This means that we need to include PyBind11 headers before any standard library headers. Enforce this by applying the Python.hh rules for anything in pybind11/. Change-Id: Id175a4f613960a17f84f98b81bfd02806e905d5a Signed-off-by: Andreas Sandberg Reviewed-by: Nikos Nikoleris Reviewed-by: Curtis Dunham Reviewed-on: https://gem5-review.googlesource.com/3120 Reviewed-by: Jason Lowe-Power Reviewed-by: Tony Gutierrez --- diff --git a/util/style/sort_includes.py b/util/style/sort_includes.py index d1a25ee6b..cb88fec2d 100644 --- a/util/style/sort_includes.py +++ b/util/style/sort_includes.py @@ -158,6 +158,8 @@ class SortIncludes(object): includes_re = ( ('main', '""', _include_matcher_main()), ('python', '<>', _include_matcher_fname("^Python\.h$")), + ('pybind', '""', _include_matcher_fname("^pybind11/.*\.h$", + delim='""')), ('c', '<>', _include_matcher_fname("^.*\.h$")), ('stl', '<>', _include_matcher_fname("^\w+$")), ('cc', '<>', _include_matcher_fname("^.*\.(hh|hxx|hpp|H)$")), @@ -170,6 +172,7 @@ class SortIncludes(object): block_order = ( ('python', ), + ('pybind', ), ('main', ), ('c', ), ('stl', ),