@@ -59,7 +59,7 @@ struct coap_service {
59
59
};
60
60
61
61
#define __z_coap_service_define (_name , _host , _port , _flags , _res_begin , _res_end ) \
62
- static struct coap_service_data coap_service_data_## _name = { \
62
+ static struct coap_service_data _CONCAT( coap_service_data_, _name) = { \
63
63
.sock_fd = -1, \
64
64
}; \
65
65
const STRUCT_SECTION_ITERABLE(coap_service, _name) = { \
@@ -69,7 +69,7 @@ struct coap_service {
69
69
.flags = _flags, \
70
70
.res_begin = (_res_begin), \
71
71
.res_end = (_res_end), \
72
- .data = &coap_service_data_## _name, \
72
+ .data = &_CONCAT( coap_service_data_, _name), \
73
73
}
74
74
75
75
/** @endcond */
@@ -111,8 +111,8 @@ struct coap_service {
111
111
* @param _service Name of the associated service.
112
112
*/
113
113
#define COAP_RESOURCE_DEFINE (_name , _service , ...) \
114
- STRUCT_SECTION_ITERABLE_ALTERNATE(coap_resource_## _service, coap_resource, _name) \
115
- = __VA_ARGS__
114
+ STRUCT_SECTION_ITERABLE_ALTERNATE(_CONCAT( coap_resource_, _service) , coap_resource, \
115
+ _name) = __VA_ARGS__
116
116
117
117
/**
118
118
* @brief Define a CoAP service with static resources.
@@ -132,11 +132,11 @@ struct coap_service {
132
132
* @param _flags Configuration flags @see @ref COAP_SERVICE_FLAGS.
133
133
*/
134
134
#define COAP_SERVICE_DEFINE (_name , _host , _port , _flags ) \
135
- extern struct coap_resource _CONCAT(_coap_resource_## _name, _list_start)[]; \
136
- extern struct coap_resource _CONCAT(_coap_resource_## _name, _list_end)[]; \
135
+ extern struct coap_resource _CONCAT(_CONCAT( _coap_resource_, _name) , _list_start)[]; \
136
+ extern struct coap_resource _CONCAT(_CONCAT( _coap_resource_, _name) , _list_end)[]; \
137
137
__z_coap_service_define(_name, _host, _port, _flags, \
138
- &_CONCAT(_coap_resource_## _name, _list_start)[0], \
139
- &_CONCAT(_coap_resource_## _name, _list_end)[0])
138
+ &_CONCAT(_CONCAT( _coap_resource_, _name) , _list_start)[0], \
139
+ &_CONCAT(_CONCAT( _coap_resource_, _name) , _list_end)[0])
140
140
141
141
/**
142
142
* @brief Count the number of CoAP services.
@@ -177,7 +177,7 @@ struct coap_service {
177
177
* @param _it Name of iterator (of type @ref coap_resource)
178
178
*/
179
179
#define COAP_RESOURCE_FOREACH (_service , _it ) \
180
- STRUCT_SECTION_FOREACH_ALTERNATE(coap_resource_## _service, coap_resource, _it)
180
+ STRUCT_SECTION_FOREACH_ALTERNATE(_CONCAT( coap_resource_, _service) , coap_resource, _it)
181
181
182
182
/**
183
183
* @brief Iterate over all static resources associated with @p _service .
0 commit comments