diff options
| author | Robert Bielik <Robert.Bielik@dirac.com> | 2019-12-30 10:38:14 +0100 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-12-30 11:55:29 -0800 |
| commit | 3890f856068542c6ddb7b498a2e313b026450bd2 (patch) | |
| tree | 1699400c7cb5567effb00dec28dc7fa9b4bffeed /src/core/pipe.c | |
| parent | c9736702920ec15e0f4a5b58abf60ea2a8d7e9e4 (diff) | |
| download | nng-3890f856068542c6ddb7b498a2e313b026450bd2.tar.gz nng-3890f856068542c6ddb7b498a2e313b026450bd2.tar.bz2 nng-3890f856068542c6ddb7b498a2e313b026450bd2.zip | |
Fix compilation errors and warnings when NNG_ENABLE_STATS is OFF
Diffstat (limited to 'src/core/pipe.c')
| -rw-r--r-- | src/core/pipe.c | 10 |
1 files changed, 10 insertions, 0 deletions
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 |
