2022-06-03 19:15:11 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2016-01-26 17:47:22 +00:00
|
|
|
* Copyright (c) Intel Corporation.
|
2016-01-08 21:37:12 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2016-04-29 18:04:33 +00:00
|
|
|
/** \file
|
|
|
|
* Runtime and compile-time assert macros
|
|
|
|
*/
|
|
|
|
|
2016-01-08 21:37:12 +00:00
|
|
|
#ifndef SPDK_ASSERT_H
|
|
|
|
#define SPDK_ASSERT_H
|
|
|
|
|
2017-05-01 20:22:48 +00:00
|
|
|
#include "spdk/stdinc.h"
|
|
|
|
|
2016-02-12 14:52:35 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-01-08 21:37:12 +00:00
|
|
|
#ifdef static_assert
|
|
|
|
#define SPDK_STATIC_ASSERT(cond, msg) static_assert(cond, msg)
|
|
|
|
#else
|
2017-01-04 21:59:44 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2016-03-25 23:35:23 +00:00
|
|
|
#define SPDK_STATIC_ASSERT(cond, msg)
|
2016-01-08 21:37:12 +00:00
|
|
|
#endif
|
|
|
|
|
2016-02-12 14:52:35 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-01-08 21:37:12 +00:00
|
|
|
#endif /* SPDK_ASSERT_H */
|