Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize ifdef macro handlings for configs #1694

Merged
merged 3 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
void
nni_show_backtrace(void)
{
#if NNG_HAVE_BACKTRACE
#ifdef NNG_HAVE_BACKTRACE
void *frames[50];
int nframes;

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
8 changes: 4 additions & 4 deletions src/sp/protocol/pair1/pair.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,15 @@ pair1_pipe_send(pair1_pipe *p, nni_msg *m)
// assumption: we have unique access to the message at this point.
NNI_ASSERT(!nni_msg_shared(m));

#if NNG_TEST_LIB
#ifdef NNG_TEST_LIB
if (s->inject_header) {
goto inject;
}
#endif
NNI_ASSERT(nni_msg_header_len(m) == sizeof(uint32_t));
nni_msg_header_poke_u32(m, nni_msg_header_peek_u32(m) + 1);

#if NNG_TEST_LIB
#ifdef NNG_TEST_LIB
inject:
#endif

Expand All @@ -531,7 +531,7 @@ pair1_sock_send(void *arg, nni_aio *aio)
return;
}

#if NNG_TEST_LIB
#ifdef NNG_TEST_LIB
if (s->inject_header) {
goto inject;
}
Expand All @@ -554,7 +554,7 @@ pair1_sock_send(void *arg, nni_aio *aio)
nni_msg_header_append_u32(m, 0);
}

#if NNG_TEST_LIB
#ifdef NNG_TEST_LIB
inject:
#endif

Expand Down
Loading