From 14c350dfc73af1c5ae162ab8e563efbfd15de7be Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 27 Oct 2011 21:10:43 +0000 Subject: [PATCH] Explicitly declare environ variable. While POSIX and SUS both mandate this variable existence, they don't say that it needs to be declared anywhere and it actually doesn't seem to be declared under Solaris when using Sun CC and so using it resulted in compilation errors. Just declare it ourselves to avoid them. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/utilscmn.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 07a7eeb..17b6eb5 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -580,10 +580,12 @@ bool wxGetEnvMap(wxEnvVariableHashMap *map) #else // non-MSVC non-Mac // Not sure if other compilers have _tenviron so use the (more standard) // ANSI version only for them. -#ifdef __BSD__ - // POSIX, but not in an include file + + // 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 + // declared in several common systems (some BSDs, Solaris with native CC). extern char **environ; -#endif + char **env = environ; #endif -- 2.7.4