]> git.cworth.org Git - apitrace/blobdiff - common/os_process.hpp
image: Make PNG writing an Image method.
[apitrace] / common / os_process.hpp
index f1dd5172b6cf777b40c5363c4270f71ae11fddd5..ba53408ccb8faa662df5d6f3ed021ce5e7d890f9 100644 (file)
 #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);