mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-03 05:56:57 +00:00
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>
14 lines
343 B
C
14 lines
343 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
#include <acrn_common.h>
|
|
|
|
#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]
|
|
|
|
CTASSERT(sizeof(struct vhm_request) == (4096U/VHM_REQUEST_MAX));
|