summaryrefslogtreecommitdiffstats
path: root/source/core/slang-platform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/slang-platform.cpp')
-rw-r--r--source/core/slang-platform.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/core/slang-platform.cpp b/source/core/slang-platform.cpp
index e735216f4..d02951e0b 100644
--- a/source/core/slang-platform.cpp
+++ b/source/core/slang-platform.cpp
@@ -1,4 +1,7 @@
// slang-platform.cpp
+
+#define _CRT_SECURE_NO_WARNINGS
+
#include "slang-platform.h"
#include "slang-common.h"
@@ -197,6 +200,18 @@ SLANG_COMPILE_TIME_ASSERT(E_OUTOFMEMORY == SLANG_E_OUT_OF_MEMORY);
#endif // _WIN32
+
+/* static */SlangResult PlatformUtil::getEnvironmentVariable(const UnownedStringSlice& name, StringBuilder& out)
+{
+ const char* value = getenv(String(name).getBuffer());
+ if (value)
+ {
+ out.append(value);
+ return SLANG_OK;
+ }
+ return SLANG_E_NOT_FOUND;
+}
+
/* static */PlatformKind PlatformUtil::getPlatformKind()
{
#if SLANG_WINRT