From b5e2dc5921e387d071a63468d380d17a04b7c643 Mon Sep 17 00:00:00 2001
From: Dimitri Papadopoulos
 <3234522+DimitriPapadopoulos@users.noreply.github.com>
Date: Sun, 22 Mar 2020 14:01:31 +0100
Subject: [PATCH] Extra preprocessor checks

Check we have either HAVE_USR_SBIN_PPPD or HAVE_USR_SBIN_PPP,
not both, not none. Just in case.
---
 src/main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c
index afe24ca..d62a347 100644
--- a/src/main.c
+++ b/src/main.c
@@ -29,7 +29,9 @@
 
 #define PWD_BUFSIZ	4096
 
-#if HAVE_USR_SBIN_PPPD
+#if HAVE_USR_SBIN_PPPD && HAVE_USR_SBIN_PPP
+#error "Both HAVE_USR_SBIN_PPPD and HAVE_USR_SBIN_PPP have been defined."
+#elif HAVE_USR_SBIN_PPPD
 #define PPPD_USAGE \
 "                    [--pppd-use-peerdns=<0|1>] [--pppd-log=<file>]\n" \
 "                    [--pppd-ifname=<string>] [--pppd-ipparam=<string>]\n" \
@@ -50,13 +52,14 @@
 "  --pppd-call=<name>            Move most pppd options from pppd cmdline to\n" \
 "                                /etc/ppp/peers/<name> and invoke pppd with\n" \
 "                                'call <name>'\n"
-#endif
-#if HAVE_USR_SBIN_PPP
+#elif HAVE_USR_SBIN_PPP
 #define PPPD_USAGE \
 "                    [--ppp-system=<system>]\n"
 #define PPPD_HELP \
 "  --ppp-system=<system>         Connect to the specified system as defined in\n" \
 "                                /etc/ppp/ppp.conf\n"
+#else
+#error "Neither HAVE_USR_SBIN_PPPD nor HAVE_USR_SBIN_PPP have been defined."
 #endif
 
 #if HAVE_RESOLVCONF
-- 
GitLab