OXYGENHUB
◆ main openmsx / src / utils / setenv.hh
392 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef SETENV_HH
2
#define SETENV_HH
3
4
#include <cstdlib> // already sufficient for Linux
5
6
#ifdef _WIN32
7
8
// Windows doesn't have setenv(), reimplement (a slightly simplified version)
9
// in terms of _putenv_s().
10
static int setenv(const char* name, const char* value, int overwrite)
11
{
12
	if (!overwrite && getenv(name)) {
13
		return 0;
14
	}
15
	return _putenv_s(name, value);
16
}
17
18
#endif // _WIN32
19
20
#endif