diff --git a/src/catools/caget.c b/src/catools/caget.c index 74a46edad..a92d79d08 100644 --- a/src/catools/caget.c +++ b/src/catools/caget.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "tool_lib.h" diff --git a/src/libCom/osi/os/WIN32/epicsGetopt.c b/src/libCom/osi/os/WIN32/epicsGetopt.c index 7865a04c4..97bb11f47 100644 --- a/src/libCom/osi/os/WIN32/epicsGetopt.c +++ b/src/libCom/osi/os/WIN32/epicsGetopt.c @@ -39,12 +39,18 @@ static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; #include #include +#define epicsExportSharedSymbols +#include + #define _getprogname() nargv[0] +epicsShareDef int opterr = 1, /* if error message should be printed */ optind = 1, /* index into parent argv vector */ - optopt, /* character checked for validity */ - optreset; /* reset getopt */ + optopt; /* character checked for validity */ +int optreset; /* reset getopt */ + +epicsShareDef char *optarg; /* argument associated with option */ #define BADCH (int)'?' @@ -55,8 +61,7 @@ char *optarg; /* argument associated with option */ * getopt -- * Parse argc/argv argument vector. */ -int -getopt(nargc, nargv, ostr) +int getopt(nargc, nargv, ostr) int nargc; char * const *nargv; const char *ostr; diff --git a/src/libCom/osi/os/WIN32/epicsGetopt.h b/src/libCom/osi/os/WIN32/epicsGetopt.h index 52f64e764..aa3bc7422 100644 --- a/src/libCom/osi/os/WIN32/epicsGetopt.h +++ b/src/libCom/osi/os/WIN32/epicsGetopt.h @@ -12,15 +12,17 @@ #ifndef _EPICS_GETOPT_H #define _EPICS_GETOPT_H +#include "shareLib.h" + #ifdef __cplusplus extern "C" { #endif -int getopt(int argc, char * const argv[], const char *optstring); +epicsShareFunc int getopt(int argc, char * const argv[], const char *optstring); -extern char *optarg; +epicsShareExtern char *optarg; -extern int optind, opterr, optopt; +epicsShareExtern int optind, opterr, optopt; #ifdef __cplusplus }