diff options
author | Guy Harris <gharris@sonic.net> | 2021-02-14 12:54:42 -0800 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-02-14 14:43:42 -0800 |
commit | c0711693ab166b22664a68f01224c4ba682e1207 (patch) | |
tree | 136ac536c7ec89f94b337ef9c3ef3f13469e6f03 /text2pcap.c | |
parent | 3387eef8367ca7b16b5515635f79d971bde97c5e (diff) |
Enable -Wredundant-decls.
Add it to the default list of checks, and fix some errors it causes.
(Sadly, it doesn't work in CLang.)
Diffstat (limited to 'text2pcap.c')
-rw-r--r-- | text2pcap.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/text2pcap.c b/text2pcap.c index 8e3a1b7273..9cdee935de 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -112,17 +112,22 @@ #include <time.h> #include <glib.h> -#ifdef HAVE_GETOPT_H +/* + * If we have getopt_long() in the system library, include <getopt.h>. + * Otherwise, we're using our own getopt_long() (either because the + * system has getopt() but not getopt_long(), as with some UN*Xes, + * or because it doesn't even have getopt(), as with Windows), so + * include our getopt_long()'s header. + */ +#ifdef HAVE_GETOPT_LONG #include <getopt.h> +#else +#include <wsutil/wsgetopt.h> #endif #include <errno.h> #include <assert.h> -#ifndef HAVE_GETOPT_LONG -#include "wsutil/wsgetopt.h" -#endif - #ifndef HAVE_STRPTIME # include "wsutil/strptime.h" #endif |