blob: 8844e8b02f19c8aef2ab9651aafa6837b9780959 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
/*
* Copyright (c) 2018, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef __CASSERT_H__
#define __CASSERT_H__
/*******************************************************************************
* Macro to flag a compile time assertion. It uses the preprocessor to generate
* an invalid C construct if 'cond' evaluates to false.
* The following compilation error is triggered if the assertion fails:
* "error: size of array 'msg' is negative"
******************************************************************************/
#define CASSERT(cond, msg) typedef char msg[(cond) ? 1 : -1]
#endif /* __CASSERT_H__ */
|