mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
MdePkg/Include: Use _Static_assert for clang and GNUC
The clang compiler generates the following error error: use of 'static_assert' without inclusion of <assert.h> This is due to the use of the MSC Extension static_assert. Use _Static_assert instead for clang and GNUC compilers. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
parent
aae044a130
commit
8b2256fbf2
@ -800,12 +800,14 @@ typedef UINTN *BASE_LIST;
|
||||
@param Message Raised compiler diagnostic message when expression is false.
|
||||
|
||||
**/
|
||||
#ifdef MDE_CPU_EBC
|
||||
#define STATIC_ASSERT(Expression, Message)
|
||||
#elif defined (_MSC_EXTENSIONS) || defined (__cplusplus)
|
||||
#if defined (__cplusplus)
|
||||
#define STATIC_ASSERT static_assert
|
||||
#elif defined (__GNUC__) || defined (__clang__)
|
||||
#define STATIC_ASSERT _Static_assert
|
||||
#elif defined (_MSC_EXTENSIONS)
|
||||
#define STATIC_ASSERT static_assert
|
||||
#else
|
||||
#define STATIC_ASSERT _Static_assert
|
||||
#error STATIC_ASSERT() definiton not available
|
||||
#endif
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user