Do not declare "environ" variable ourselves under MSW.

The changes of r69564 making "environ" declaration unconditional broke
MinGW 4.6 build, presumably because "environ" is declared differently (as DLL
exported?) there, so avoid declaring it under MSW, we don't need to do it
there anyhow as it's always defined in system headers.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-12-04 12:26:24 +00:00
parent f27f9577ca
commit b54a0e3913

View File

@@ -583,8 +583,17 @@ bool wxGetEnvMap(wxEnvVariableHashMap *map)
// Both POSIX and Single UNIX Specification say that this variable must // Both POSIX and Single UNIX Specification say that this variable must
// exist but not that it must be declared anywhere and, indeed, it's not // exist but not that it must be declared anywhere and, indeed, it's not
// declared in several common systems (some BSDs, Solaris with native CC). // declared in several common systems (some BSDs, Solaris with native CC)
// so we (re)declare it ourselves to deal with these cases. However we do
// not do this under MSW where there can be DLL-related complications, i.e.
// the variable might be DLL-imported or not. Luckily we don't have to
// worry about this as all MSW compilers do seem to define it in their
// standard headers anyhow so we can just rely on already having the
// correct declaration. And if this turns out to be wrong, we can always
// add a configure test checking whether it is declared later.
#ifndef __WXMSW__
extern char **environ; extern char **environ;
#endif // !__WXMSW__
char **env = environ; char **env = environ;
#endif #endif