[PATCHv2 1/5] compiler.h: add host_build()

sbabic at denx.de sbabic at denx.de
Sat Dec 26 16:53:56 CET 2020


> 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 <sebastian.reichel at collabora.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
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
=====================================================================


More information about the U-Boot mailing list