aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-11-23 07:09:52 -0800
committerGarrett D'Amore <garrett@damore.org>2018-11-23 07:09:52 -0800
commit030fc34314d97874d3e4f209d78277d1f3981a0e (patch)
tree10d1c32c2dde0ac874306ebdc16c95046c06dd3b /src/core
parentd6bb25e1e0a25cb5aa781ac4f90b513fd5624f50 (diff)
downloadnng-030fc34314d97874d3e4f209d78277d1f3981a0e.tar.gz
nng-030fc34314d97874d3e4f209d78277d1f3981a0e.tar.bz2
nng-030fc34314d97874d3e4f209d78277d1f3981a0e.zip
fixes #799 Compile error on Windows with disabled stats
Diffstat (limited to 'src/core')
-rw-r--r--src/core/pipe.c8
-rw-r--r--src/core/stats.h2
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
};