
19 Dec
2020
19 Dec
'20
3:28 a.m.
On Mon, 14 Dec 2020 at 16:42, Sebastian Reichel sebastian.reichel@collabora.com wrote:
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.
eliminate
Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com
include/compiler.h | 9 +++++++++ 1 file changed, 9 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org