[1/4] lib: add extension keyword to statement expressions
Checks
Commit Message
Add __extension__ keyword to gcc statement expression extensions.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/ethdev/rte_mtr.c | 10 +++++-----
lib/ethdev/rte_tm.c | 6 +++---
lib/pipeline/rte_pipeline.c | 8 ++++----
lib/pipeline/rte_swx_pipeline_internal.h | 2 +-
lib/port/rte_port_source_sink.c | 4 ++--
5 files changed, 15 insertions(+), 15 deletions(-)
@@ -41,14 +41,14 @@
}
#define RTE_MTR_FUNC(port_id, func) \
-({ \
+__extension__ ({ \
const struct rte_mtr_ops *ops = \
- rte_mtr_ops_get(port_id, error); \
- if (ops == NULL) \
+ rte_mtr_ops_get(port_id, error); \
+ if (ops == NULL) \
return -rte_errno; \
\
if (ops->func == NULL) \
- return -rte_mtr_error_set(error, \
+ return -rte_mtr_error_set(error, \
ENOSYS, \
RTE_MTR_ERROR_TYPE_UNSPECIFIED, \
NULL, \
@@ -58,7 +58,7 @@
})
#define RTE_MTR_HNDL_FUNC(port_id, func) \
-({ \
+__extension__ ({ \
const struct rte_mtr_ops *ops = \
rte_mtr_ops_get(port_id, error); \
if (ops == NULL) \
@@ -40,11 +40,11 @@
return ops;
}
-#define RTE_TM_FUNC(port_id, func) \
-({ \
+#define RTE_TM_FUNC(port_id, func) \
+__extension__ ({ \
const struct rte_tm_ops *ops = \
rte_tm_ops_get(port_id, error); \
- if (ops == NULL) \
+ if (ops == NULL) \
return -rte_errno; \
\
if (ops->func == NULL) \
@@ -17,16 +17,16 @@
#ifdef RTE_PIPELINE_STATS_COLLECT
#define RTE_PIPELINE_STATS_AH_DROP_WRITE(p, mask) \
- ({ (p)->n_pkts_ah_drop = rte_popcount64(mask); })
+ __extension__ ({ (p)->n_pkts_ah_drop = rte_popcount64(mask); })
#define RTE_PIPELINE_STATS_AH_DROP_READ(p, counter) \
- ({ (counter) += (p)->n_pkts_ah_drop; (p)->n_pkts_ah_drop = 0; })
+ __extension__ ({ (counter) += (p)->n_pkts_ah_drop; (p)->n_pkts_ah_drop = 0; })
#define RTE_PIPELINE_STATS_TABLE_DROP0(p) \
- ({ (p)->pkts_drop_mask = (p)->action_mask0[RTE_PIPELINE_ACTION_DROP]; })
+ __extension__ ({ (p)->pkts_drop_mask = (p)->action_mask0[RTE_PIPELINE_ACTION_DROP]; })
#define RTE_PIPELINE_STATS_TABLE_DROP1(p, counter) \
-({ \
+__extension__ ({ \
uint64_t mask = (p)->action_mask0[RTE_PIPELINE_ACTION_DROP]; \
mask ^= (p)->pkts_drop_mask; \
(counter) += rte_popcount64(mask); \
@@ -1485,7 +1485,7 @@ struct thread {
#endif
#define METADATA_READ(thread, offset, n_bits) \
-({ \
+__extension__ ({ \
uint64_t *m64_ptr = (uint64_t *)&(thread)->metadata[offset]; \
uint64_t m64 = *m64_ptr; \
uint64_t m64_mask = UINT64_MAX >> (64 - (n_bits)); \
@@ -176,7 +176,7 @@ struct rte_port_source {
#else /* RTE_PORT_PCAP */
#define PCAP_SOURCE_LOAD(port, file_name, n_bytes, socket_id) \
-({ \
+__extension__ ({ \
int _ret = 0; \
\
if (file_name) { \
@@ -429,7 +429,7 @@ struct rte_port_sink {
#else
#define PCAP_SINK_OPEN(port, file_name, max_n_pkts) \
-({ \
+__extension__ ({ \
int _ret = 0; \
\
if (file_name) { \