Skip to content

Commit e6189cc

Browse files
committed
Proper macro guarding.
1 parent bb0164e commit e6189cc

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

dtls-mcast/mcast-peer.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
/* Epoch for the multicast session */
6262
#define MCAST_EPOCH 1
6363

64+
#if defined(WOLFSSL_DTLS) && defined(WOLFSSL_MULTICAST)
65+
6466
/* Global flag for clean shutdown */
6567
static volatile int running = 1;
6668

@@ -227,12 +229,6 @@ int main(int argc, char** argv)
227229
wolfSSL_Debugging_ON();
228230
#endif
229231

230-
#ifndef WOLFSSL_MULTICAST
231-
fprintf(stderr, "Error: wolfSSL not built with multicast support\n");
232-
fprintf(stderr, "Rebuild with: ./configure --enable-dtls --enable-mcast\n");
233-
return 1;
234-
#else
235-
236232
/* Initialize the pre-shared secrets (same for all peers) */
237233
memset(pms, 0x23, sizeof(pms));
238234
memset(clientRandom, 0xA5, sizeof(clientRandom));
@@ -450,6 +446,12 @@ int main(int argc, char** argv)
450446
wolfSSL_Cleanup();
451447

452448
printf("Node %d: Goodbye!\n", myId);
453-
#endif /* WOLFSSL_MULTICAST */
454449
return 0;
455450
}
451+
#else
452+
int main()
453+
{
454+
fprintf(stderr, "Please configure the wolfssl library with --enable-dtls --enable-mcast.\n");
455+
return 0;
456+
}
457+
#endif /* WOLFSSL_DTLS && WOLFSSL_MULTICAST */

0 commit comments

Comments
 (0)