Skip to content

Commit

Permalink
fix: use ifdef for NNG_TEST_LIB
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 committed Oct 22, 2023
1 parent 4c321bb commit d2aa59d
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit d2aa59d

Please sign in to comment.