Skip to content

Commit

Permalink
fix: use ifdef for NNG_ENABLE_STATS
Browse files Browse the repository at this point in the history
In some places, we use ifdef, and others if.

This normalizes for always using ifdef, so we can compile when
this macro is not defined.
  • Loading branch information
casaroli authored and gdamore committed Nov 26, 2023
1 parent d6fd9b2 commit a228f85
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/dialer.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ nni_dialer_destroy(nni_dialer *d)
NNI_FREE_STRUCT(d);
}

#if NNG_ENABLE_STATS
#ifdef NNG_ENABLE_STATS
static void
dialer_stat_init(nni_dialer *d, nni_stat_item *item, const nni_stat_info *info)
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ nni_listener_getopt(
void
nni_listener_add_stat(nni_listener *l, nni_stat_item *item)
{
#if NNG_ENABLE_STATS
#ifdef NNG_ENABLE_STATS
nni_stat_add(&l->st_root, item);
#else
NNI_ARG_UNUSED(l);
Expand Down
2 changes: 1 addition & 1 deletion src/core/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ nni_pipe_create_listener(nni_pipe **pp, nni_listener *l, void *tran_data)
return (rv);
}
p->p_listener = l;
#if NNG_ENABLE_STATS
#ifdef NNG_ENABLE_STATS
static const nni_stat_info listener_info = {
.si_name = "listener",
.si_desc = "listener for pipe",
Expand Down

0 comments on commit a228f85

Please sign in to comment.