From c720c8a3422906283a7058de153348e6b48c2370 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Wed, 4 Jan 2017 14:59:44 -0700 Subject: [PATCH] assert.h: document SPDK_STATIC_ASSERT The Doxygen build does not define static_assert, so the doc comment needs to be on the definition under the #else branch. Change-Id: Ib05ddc729c274810d2963716995ac7c9ce68896b Signed-off-by: Daniel Verkamp --- include/spdk/assert.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/spdk/assert.h b/include/spdk/assert.h index 2f3d03db6..1bdc1cb73 100644 --- a/include/spdk/assert.h +++ b/include/spdk/assert.h @@ -47,6 +47,14 @@ extern "C" { #ifdef static_assert #define SPDK_STATIC_ASSERT(cond, msg) static_assert(cond, msg) #else +/** + * Compatibility wrapper for static_assert. + * + * This won't actually enforce the condition when compiled with an environment that doesn't support + * C11 static_assert; it is only intended to allow end users with old compilers to build the package. + * + * Developers should use a recent compiler that provides static_assert. + */ #define SPDK_STATIC_ASSERT(cond, msg) #endif