Skip to content

Commit

Permalink
fixes nanomsg#799 Compile error on Windows with disabled stats
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Nov 23, 2018
1 parent d6bb25e commit 030fc34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/core/stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit 030fc34

Please sign in to comment.