summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_unix.cpp
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2016-12-13 21:52:11 -0800
committerJake Petroules <jake.petroules@qt.io>2016-12-16 09:15:03 +0000
commitff19ebcc2d9c9668af24fe8add9f70c160776367 (patch)
treedcd706840bd6fb8c9c14a2f87e126a6d742c57fb /src/corelib/io/qprocess_unix.cpp
parent510e699d15aa002fada7536d72eee15207986096 (diff)
Make QProcessEnvironment available on Apple Platforms and VxWorks
All Apple Platforms have public API to get the environment; there is no reason to exclude it from the UIKit subset. It can be useful for debugging in Xcode, in particular. Furthermore, VxWorks appears to have support for the Unix environment API, so don't exclude it either. [ChangeLog][QtCore] QProcessEnvironment is now available on iOS, tvOS, watchOS, and VxWorks Change-Id: Ife3745f9b0a588de521a714b4273c5c08eeef286 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r--src/corelib/io/qprocess_unix.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 39ec370d9c..deca5c50ff 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -119,21 +119,11 @@ QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
-#if QT_CONFIG(processenvironment)
-
-QT_BEGIN_INCLUDE_NAMESPACE
-#if defined(Q_OS_MACOS)
-# include <crt_externs.h>
-# define environ (*_NSGetEnviron())
-#else
-extern char **environ;
-#endif
-QT_END_INCLUDE_NAMESPACE
+#if QT_CONFIG(processenvironment) && !defined(Q_OS_DARWIN)
QProcessEnvironment QProcessEnvironment::systemEnvironment()
{
QProcessEnvironment env;
-#if !defined(QT_PLATFORM_UIKIT)
const char *entry;
for (int count = 0; (entry = environ[count]); ++count) {
const char *equal = strchr(entry, '=');
@@ -145,11 +135,10 @@ QProcessEnvironment QProcessEnvironment::systemEnvironment()
env.d->hash.insert(QProcessEnvironmentPrivate::Key(name),
QProcessEnvironmentPrivate::Value(value));
}
-#endif
return env;
}
-#endif // QT_CONFIG(processenvironment)
+#endif // QT_CONFIG(processenvironment) && !defined(Q_OS_DARWIN)
#if QT_CONFIG(process)