Fix popen pclose warnings compiling under wine

Fix i686-w64-mingw32-g++ compiler on linux warning:

In file included from Swig/swig.h:21:0,
                 from Swig/misc.c:14:
Swig/misc.c:1125:14: warning: ‘_popen’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 extern FILE *popen(const char *command, const char *type);
              ^
Swig/misc.c:1126:12: warning: ‘_pclose’ redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 extern int pclose(FILE *stream);
This commit is contained in:
William S Fulton 2017-01-28 01:22:06 +00:00
commit 25ac8f97f6

View file

@ -1117,19 +1117,17 @@ int Swig_scopename_check(const String *s) {
*
* Printf(stderr,"%(command:sed 's/[a-z]/\U\\1/' <<<)s","hello") -> Hello
* ----------------------------------------------------------------------------- */
#if defined(HAVE_POPEN)
# if defined(_MSC_VER)
# define popen _popen
# define pclose _pclose
# else
extern FILE *popen(const char *command, const char *type);
extern int pclose(FILE *stream);
#if defined(_MSC_VER)
# define popen _popen
# define pclose _pclose
# if !defined(HAVE_POPEN)
# define HAVE_POPEN 1
# endif
#else
# if defined(_MSC_VER)
# define HAVE_POPEN 1
# define popen _popen
# define pclose _pclose
# if !defined(_WIN32)
/* These Posix functions are not ISO C and so are not always defined in stdio.h */
extern FILE *popen(const char *command, const char *type);
extern int pclose(FILE *stream);
# endif
#endif