Now that static_assert is available, better than pre-processor use of #if condition.
Signed-off-by: Stephen Hemminger <step...@networkplumber.org> Acked-by: Morten Brørup <m...@smartsharesystems.com> --- lib/hash/rte_cuckoo_hash.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h index 16fe999c4c..90fda7d7e0 100644 --- a/lib/hash/rte_cuckoo_hash.h +++ b/lib/hash/rte_cuckoo_hash.h @@ -24,9 +24,8 @@ */ #define RTE_HASH_BUCKET_ENTRIES 8 -#if !RTE_IS_POWER_OF_2(RTE_HASH_BUCKET_ENTRIES) -#error RTE_HASH_BUCKET_ENTRIES must be a power of 2 -#endif +static_assert(RTE_IS_POWER_OF_2(RTE_HASH_BUCKET_ENTRIES), + "RTE_HASH_BUCKET_ENTRIES must be a power of 2"); #define NULL_SIGNATURE 0 -- 2.47.2