Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Unified Diff: runtime/bin/platform_macos.cc

Issue 1174343006: Landing https://codereview.chromium.org/1171223003/ for Chinmay. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file_system_watcher_macos.cc ('k') | runtime/bin/process_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/platform_macos.cc
diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc
index 351a829db717d47f0f0159d62b39fc06ddba3635..0e7f2f8f6ea3b640e0094719e001cab4d1e3647e 100644
--- a/runtime/bin/platform_macos.cc
+++ b/runtime/bin/platform_macos.cc
@@ -57,6 +57,16 @@ bool Platform::LocalHostname(char *buffer, intptr_t buffer_length) {
char** Platform::Environment(intptr_t* count) {
+#if defined(TARGET_OS_IOS)
+ // TODO(iposva): On Mac (desktop), _NSGetEnviron() is used to access the
+ // environ from shared libraries or bundles. This is present in crt_externs.h
+ // which is unavailable on iOS. On iOS, everything is statically linked for
+ // now. So arguably, accessing the environ directly with a "extern char
+ // **environ" will work. But this approach is brittle as the target with this
+ // CU could be a dynamic framework (introduced in iOS 8). A more elegant
+ // approach needs to be devised.
+ return NULL;
+#else
// Using environ directly is only safe as long as we do not
// provide access to modifying environment variables.
// On MacOS you have to do a bit of magic to get to the
@@ -71,6 +81,7 @@ char** Platform::Environment(intptr_t* count) {
result[current] = environ[current];
}
return result;
+#endif
}
« no previous file with comments | « runtime/bin/file_system_watcher_macos.cc ('k') | runtime/bin/process_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698