diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-11-01 16:24:47 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-11-01 16:25:30 -0800 |
commit | a77491e209e49a16cda89508e86cf71c04d6a2c4 (patch) | |
tree | 4de74d3c42651543192c3ec8527b4fdd8962d9c5 /tests/filtertest.c | |
parent | 4093bb2c65f88be21036e7f443eeb0abd5ce3ff1 (diff) |
Add a "getopt.h" header and include it instead of <unistd.h> on Windows.
We include <unistd.h> for getopt(), but, on Windows, we supply our own
getopt() (as it's a UN*X API), so supply our own header and include that
instead.
While we're at it, mark the copyright strings as unused (to squelch
compiler warnings), and don't include the headers for select() or poll()
in capturetest.c, as we don't use those APIs there (that's what
selpolltest(), which is UN*X-only, is for). <unistd.h> or "getopt.h"
should declare the getopt() external variables, so don't declare them
ourselves.
Diffstat (limited to 'tests/filtertest.c')
-rw-r--r-- | tests/filtertest.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/filtertest.c b/tests/filtertest.c index 60709c78..5f1b9be3 100644 --- a/tests/filtertest.c +++ b/tests/filtertest.c @@ -34,7 +34,9 @@ The Regents of the University of California. All rights reserved.\n"; #include <stdlib.h> #include <string.h> #include <stdarg.h> -#ifndef _WIN32 +#ifdef _WIN32 +#include "getopt.h" +#else #include <unistd.h> #endif #include <fcntl.h> @@ -61,9 +63,6 @@ static void error(const char *, ...) static void warn(const char *, ...) __attribute__((format (printf, 1, 2))); -extern int optind; -extern int opterr; -extern char *optarg; #ifdef BDEBUG int dflag; #endif |