diff options
| author | Marco Casaroli <marco.casaroli@gmail.com> | 2023-10-22 09:39:21 +0200 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2023-11-25 16:23:30 -0800 |
| commit | a228f85ccc38bcbf93cc16924cea67d771f26baf (patch) | |
| tree | df1e14ca76bd30bdcbc00d69c2ab21f051bb3ce5 /src | |
| parent | d6fd9b2a737373f5087b6ccf882f926570e1ab60 (diff) | |
| download | nng-a228f85ccc38bcbf93cc16924cea67d771f26baf.tar.gz nng-a228f85ccc38bcbf93cc16924cea67d771f26baf.tar.bz2 nng-a228f85ccc38bcbf93cc16924cea67d771f26baf.zip | |
fix: use ifdef for NNG_ENABLE_STATS
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/dialer.c | 2 | ||||
| -rw-r--r-- | src/core/listener.c | 2 | ||||
| -rw-r--r-- | src/core/pipe.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/core/dialer.c b/src/core/dialer.c index 7dd018f6..55a46efb 100644 --- a/src/core/dialer.c +++ b/src/core/dialer.c @@ -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) { diff --git a/src/core/listener.c b/src/core/listener.c index 80aa17d7..7d3e3e0d 100644 --- a/src/core/listener.c +++ b/src/core/listener.c @@ -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); diff --git a/src/core/pipe.c b/src/core/pipe.c index 06a57bf5..58267d69 100644 --- a/src/core/pipe.c +++ b/src/core/pipe.c @@ -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", |
