Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
lwm2m_path.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Endian Technologies AB
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_NET_LWM2M_PATH_H_
8#define ZEPHYR_INCLUDE_NET_LWM2M_PATH_H_
9
27#define LWM2M_PATH(...) \
28 LWM2M_PATH_MACRO(__VA_ARGS__, LWM2M_PATH4, LWM2M_PATH3, \
29 LWM2M_PATH2, LWM2M_PATH1)(__VA_ARGS__)
30
31
32/* Internal helper macros for the LWM2M_PATH macro */
33#define LWM2M_PATH_VA_NUM_ARGS(...) \
34 LWM2M_PATH_VA_NUM_ARGS_IMPL(__VA_ARGS__, 5, 4, 3, 2, 1)
35#define LWM2M_PATH_VA_NUM_ARGS_IMPL(_1, _2, _3, _4, N, ...) N
36
37#define LWM2M_PATH1(_x) #_x
38#define LWM2M_PATH2(_x, _y) #_x "/" #_y
39#define LWM2M_PATH3(_x, _y, _z) #_x "/" #_y "/" #_z
40#define LWM2M_PATH4(_a, _x, _y, _z) #_a "/" #_x "/" #_y "/" #_z
41
42#define LWM2M_PATH_MACRO(_1, _2, _3, _4, NAME, ...) NAME
43
44
45
46#endif /* ZEPHYR_INCLUDE_NET_LWM2M_PATH_H_ */