Files
kotlin-fork/kotlin-native/backend.native/tests/interop/basics/cstdlib.def
T
2022-01-13 12:43:03 +00:00

22 lines
489 B
Modula-2

headers = stdlib.h
compilerOpts.mingw = -D ADD_WINDOWS_ENV_FUNCTIONS
---
#ifdef ADD_WINDOWS_ENV_FUNCTIONS
static inline int setenv(const char *name, const char *value, int overwrite)
{
int errcode = 0;
if (!overwrite) {
size_t envsize = 0;
errcode = getenv_s(&envsize, NULL, 0, name);
if(errcode || envsize) return errcode;
}
return _putenv_s(name, value);
}
static inline int unsetenv(const char *name)
{
return _putenv_s(name, "");
}
#endif