mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 15:05:19 +00:00
Make hmu_tree_node 4 byte aligned to reduce compiler warning (#2268)
This commit is contained in:
parent
6e3c3fe9ec
commit
59e18ca3c0
|
@ -214,13 +214,16 @@ set_hmu_normal_node_next(hmu_normal_node_t *node, hmu_normal_node_t *next)
|
|||
#if defined(_MSC_VER)
|
||||
__pragma(pack(push, 1));
|
||||
#define __attr_packed
|
||||
#define __attr_aligned(a)
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define __attr_packed __attribute__((packed))
|
||||
#define __attr_aligned(a) __attribute__((aligned(a)))
|
||||
#else
|
||||
#error "packed attribute isn't used to define struct hmu_tree_node"
|
||||
#endif
|
||||
#else /* else of UINTPTR_MAX == UINT64_MAX */
|
||||
#define __attr_packed
|
||||
#define __attr_aligned(a)
|
||||
#endif
|
||||
|
||||
typedef struct hmu_tree_node {
|
||||
|
@ -229,7 +232,7 @@ typedef struct hmu_tree_node {
|
|||
struct hmu_tree_node *right;
|
||||
struct hmu_tree_node *parent;
|
||||
gc_size_t size;
|
||||
} __attr_packed hmu_tree_node_t;
|
||||
} __attr_packed __attr_aligned(4) hmu_tree_node_t;
|
||||
|
||||
#if UINTPTR_MAX == UINT64_MAX
|
||||
#if defined(_MSC_VER)
|
||||
|
|
Loading…
Reference in New Issue
Block a user