From 3890f856068542c6ddb7b498a2e313b026450bd2 Mon Sep 17 00:00:00 2001 From: Robert Bielik Date: Mon, 30 Dec 2019 10:38:14 +0100 Subject: Fix compilation errors and warnings when NNG_ENABLE_STATS is OFF --- src/core/pipe.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/pipe.c') diff --git a/src/core/pipe.c b/src/core/pipe.c index 7a632b0f..f7269eb4 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -351,15 +351,25 @@ nni_pipe_add_stat(nni_pipe *p, nni_stat_item *item) void nni_pipe_bump_rx(nni_pipe *p, size_t nbytes) { +#ifdef NNG_ENABLE_STATS nni_stat_inc_atomic(&p->p_stats.s_rxbytes, nbytes); nni_stat_inc_atomic(&p->p_stats.s_rxmsgs, 1); +#else + NNI_ARG_UNUSED(p); + NNI_ARG_UNUSED(nbytes); +#endif } void nni_pipe_bump_tx(nni_pipe *p, size_t nbytes) { +#ifdef NNG_ENABLE_STATS nni_stat_inc_atomic(&p->p_stats.s_txbytes, nbytes); nni_stat_inc_atomic(&p->p_stats.s_txmsgs, 1); +#else + NNI_ARG_UNUSED(p); + NNI_ARG_UNUSED(nbytes); +#endif } void -- cgit v1.2.3-70-g09d2