mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
dtoolutil: fix compile warnings on Windows
This commit is contained in:
parent
202a871a7e
commit
d403b16249
@ -415,7 +415,11 @@ ns_set_environment_variable(const string &var, const string &value) {
|
|||||||
// putenv() requires us to malloc a new C-style string.
|
// putenv() requires us to malloc a new C-style string.
|
||||||
char *put = (char *)malloc(putstr.length() + 1);
|
char *put = (char *)malloc(putstr.length() + 1);
|
||||||
strcpy(put, putstr.c_str());
|
strcpy(put, putstr.c_str());
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
_putenv(put);
|
||||||
|
#else
|
||||||
putenv(put);
|
putenv(put);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -433,7 +433,11 @@ temporary(const string &dirname, const string &prefix, const string &suffix,
|
|||||||
if (fdirname.empty()) {
|
if (fdirname.empty()) {
|
||||||
// If we are not given a dirname, use the system tempnam() function to
|
// If we are not given a dirname, use the system tempnam() function to
|
||||||
// create a system-defined temporary filename.
|
// create a system-defined temporary filename.
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
char *name = _tempnam(nullptr, prefix.c_str());
|
||||||
|
#else
|
||||||
char *name = tempnam(nullptr, prefix.c_str());
|
char *name = tempnam(nullptr, prefix.c_str());
|
||||||
|
#endif
|
||||||
Filename result = Filename::from_os_specific(name);
|
Filename result = Filename::from_os_specific(name);
|
||||||
free(name);
|
free(name);
|
||||||
result.set_type(type);
|
result.set_type(type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user