#define _OS_PROCESS_HPP_
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
#include "os.hpp"
namespace os {
+inline void
+setEnvironment(const char *name, const char *value) {
+#ifdef _WIN32
+ SetEnvironmentVariableA(name, value);
+#else
+ setenv(name, value, 1);
+#endif
+}
+
+
+inline void
+unsetEnvironment(const char *name) {
+#ifdef _WIN32
+ SetEnvironmentVariableA(name, NULL);
+#else
+ unsetenv(name);
+#endif
+}
+
+
int execute(char * const * args);
}
/* FIXME: Don't modify the current environment */
- setenv(TRACE_VARIABLE, wrapper.str(), 1);
+ os::setEnvironment(TRACE_VARIABLE, wrapper.str());
if (output) {
- setenv("TRACE_FILE", output, 1);
+ os::setEnvironment("TRACE_FILE", output);
}
if (verbose) {
int status = os::execute(argv);
- unsetenv(TRACE_VARIABLE);
+ os::unsetEnvironment(TRACE_VARIABLE);
if (output) {
- unsetenv("TRACE_FILE");
+ os::unsetEnvironment("TRACE_FILE");
}
return status;