windows: Provide a setenv() wrapper
This commit is contained in:
@@ -143,6 +143,18 @@ static inline struct tm *localtime_r(const time_t *timep, struct tm *result)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setenv(3) from <stdlib.h>, overwrite flag is ignored
|
||||||
|
*/
|
||||||
|
static inline int setenv(const char *name, const char *value, int overwrite)
|
||||||
|
{
|
||||||
|
if (SetEnvironmentVariableA(name, value) == 0)
|
||||||
|
{ /* failed */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dlerror(3) from <dlfcn.h>, printing error to an alloca() buffer
|
* dlerror(3) from <dlfcn.h>, printing error to an alloca() buffer
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user