blob: ecf7a068b0577a5358e15a55cf8cc9b6b6472afb [file] [log] [blame]
Xinyu Zhangade2e0a2021-03-18 16:20:54 +08001/*
2 * Copyright (c) 2021, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __ARRAY_H__
9#define __ARRAY_H__
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#ifndef ARRAY_SIZE
16#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
17#endif
18
19#ifndef IOVEC_LEN
20#define IOVEC_LEN(x) (uint32_t)ARRAY_SIZE(x)
21#endif
22
23#ifdef __cplusplus
24}
25#endif
26
27#endif /* __ARRAY_H__ */