From mboxrd@z Thu Jan 1 00:00:00 1970 From: sbabic at denx.de Date: Sat, 26 Dec 2020 16:53:56 +0100 (CET) Subject: [PATCHv2 1/5] compiler.h: add host_build() In-Reply-To: <20201214234157.202120-2-sebastian.reichel@collabora.com> Message-ID: <20201226155356.E545D82677@phobos.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > Add a host_build() function, so that it's possible to > check for software being build with USE_HOSTCC without > relying on preprocessor conditions. In other words > #ifdef USE_HOSTCC > host_only_code(); > #endif > can be written like this instead: > if (host_build()) > host_only_code(); > This improves code readability and test coverage and > compiler will eleminate this unreachable code. > Signed-off-by: Sebastian Reichel > Reviewed-by: Simon Glass Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================