[Xapian-devel] cygwin gnu_getopt linkage
Reini Urban
rurban at x-ray.at
Wed Mar 24 10:14:48 GMT 2010
Unforunately I needed the following snippet for cygwin xapian-1.1
<gnu_getopt.h> (for both, core and omega)
problem:
In file included from ../scriptindex.cc:55:
../common/gnu_getopt.h:61: warning: 'optarg' redeclared without
dllimport attribute: previous dllimport ignored
../common/gnu_getopt.h:62: warning: 'optind' redeclared without
dllimport attribute: previous dllimport ignored
../common/gnu_getopt.h:63: warning: 'opterr' redeclared without
dllimport attribute: previous dllimport ignored
../common/gnu_getopt.h:64: warning: 'optopt' redeclared without
dllimport attribute: previous dllimport ignored
gnu_getopt.h:
#ifdef __CYGWIN__
extern int __declspec(dllimport) opterr; /* if error message should be
printed */
extern int __declspec(dllimport) optind; /* index into parent argv vector */
extern int __declspec(dllimport) optopt; /* character checked for validity */
extern int __declspec(dllimport) optreset; /* reset getopt */
extern char __declspec(dllimport) *optarg; /* argument associated with option */
#else
extern char *optarg;
extern int optind;
extern int opterr;
extern int optopt;
#endif
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/
More information about the Xapian-devel
mailing list