Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix a preprocessor directive in Env PMC, and add in some TODO notes a…

…bout places we need to fix for windows (environ global is deprecated there)
  • Loading branch information...
commit b6c8207825e329fbb738090e6557091cfc9bea7e 1 parent 1a3b2f2
@Whiteknight Whiteknight authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/pmc/env.pmc
View
8 src/pmc/env.pmc
@@ -22,7 +22,7 @@ C<Env> is a singleton class which provides access to the system environment.
MS C compilers know about environ, as it is declared in stdlib.h.
OS X doesn't allow access to "environ" from within shared libraries.
*/
-#ifndef WIN32
+#ifndef _WIN32
# ifdef __APPLE_CC__
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
@@ -91,9 +91,12 @@ This method is questionable, as environ is not in ISO-C.
VTABLE INTVAL elements() {
INTVAL rv = 0;
-
+#ifndef _WIN32
while (environ[rv] != NULL)
++rv;
+#else
+ // TODO: Implement on win32
+#endif
return rv;
}
@@ -181,6 +184,7 @@ Used during iteration.
return CONST_STRING(interp, "");
}
else {
+ // TODO: Implement on win32.
STRING * const envp = Parrot_str_from_platform_cstring(interp, environ[pos]);
const INTVAL delim = STRING_index(interp, envp, CONST_STRING(interp, "="), 0);
return STRING_substr(interp, envp, 0, delim);
Please sign in to comment.
Something went wrong with that request. Please try again.