Commit 8d66c920 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

boot: bootutil: Change conditional to valid C

The change

    boot: bootutil: Simplify check for crypto backends to reduce complexity

    Adding multiple crypto backends will grow quadraticly. This change will
    ensure that the growth will be linear and generate less complexity.

unfortunately is not legal C.  It can be fixed by eliminating the
intermediate macro, so that the `defined` keywords are within the `#if`.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 30f68b85
Loading
Loading
Loading
Loading
+2 −3
Changes for boot/bootutil/include/bootutil/sha256.h: 2 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -31,10 +31,9 @@

#include "mcuboot_config/mcuboot_config.h"

#define NUM_CRYPTO_BACKENDS (defined(MCUBOOT_USE_MBED_TLS) +\
#if (defined(MCUBOOT_USE_MBED_TLS) + \
     defined(MCUBOOT_USE_TINYCRYPT) + \
			     defined(MCUBOOT_USE_CC310))
#if NUM_CRYPTO_BACKENDS != 1
     defined(MCUBOOT_USE_CC310)) != 1
    #error "One crypto backend must be defined either CC310, MBED_TLS or TINYCRYPT"
#endif