diff options
| -rw-r--r-- | src/core/pipe.c | 8 | ||||
| -rw-r--r-- | src/core/stats.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/core/pipe.c b/src/core/pipe.c index 96fb6c7d..d04c8b28 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -244,9 +244,11 @@ nni_pipe_create_dialer(nni_pipe **pp, nni_dialer *d, void *tdata) { int rv; nni_tran * tran = d->d_tran; - uint64_t id = nni_dialer_id(d); nni_pipe * p; nni_stat_item *st; +#ifdef NNG_ENABLE_STATS + uint64_t id = nni_dialer_id(d); +#endif if ((rv = pipe_create(&p, d->d_sock, tran, tdata)) != 0) { return (rv); @@ -265,9 +267,11 @@ nni_pipe_create_listener(nni_pipe **pp, nni_listener *l, void *tdata) { int rv; nni_tran * tran = l->l_tran; - uint64_t id = nni_listener_id(l); nni_pipe * p; nni_stat_item *st; +#ifdef NNG_ENABLE_STATS + uint64_t id = nni_listener_id(l); +#endif if ((rv = pipe_create(&p, l->l_sock, tran, tdata)) != 0) { return (rv); diff --git a/src/core/stats.h b/src/core/stats.h index 87bd90a7..215e07d8 100644 --- a/src/core/stats.h +++ b/src/core/stats.h @@ -49,6 +49,8 @@ struct nni_stat_item { const char * si_string; // string value (NULL for numerics) uint64_t si_number; // numeric value nni_atomic_u64 si_atomic; // atomic value +#else + char si_disabled; // place holder, cannot be empty in C #endif }; |
