mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-30 23:16:40 +00:00
hv: fix a minor bug of static checks
When a macro is expanded, the two tokens on either side of each ‘##’ operator are combined into a single token, which then replaces the ‘##’ and the two original tokens in the macro expansion. So we need use CAT__ to expand the __LINE__ MACRO and use CAT_ to combine the expaneded MACRO. Tracked-on: #1750 Signed-off-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
parent
0800624fe5
commit
121454c4bd
@ -6,7 +6,8 @@
|
||||
#include <hypervisor.h>
|
||||
#include <vm0_boot.h>
|
||||
|
||||
#define CAT_(A,B) A ## B
|
||||
#define CAT__(A,B) A ## B
|
||||
#define CAT_(A,B) CAT__(A,B)
|
||||
#define CTASSERT(expr) \
|
||||
typedef int CAT_(CTA_DummyType,__LINE__)[(expr) ? 1 : -1]
|
||||
|
||||
|
@ -5,7 +5,8 @@
|
||||
*/
|
||||
#include <acrn_common.h>
|
||||
|
||||
#define CAT_(A,B) A ## B
|
||||
#define CAT__(A,B) A ## B
|
||||
#define CAT_(A,B) CAT__(A,B)
|
||||
#define CTASSERT(expr) \
|
||||
typedef int CAT_(CTA_DummyType,__LINE__)[(expr) ? 1 : -1]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user