- fix warning about deprecated function

This commit is contained in:
Dmytro Bogovych 2018-09-27 11:05:05 +03:00
parent 2f69f58088
commit 17f8d322c1
1 changed files with 12 additions and 0 deletions

View File

@ -32,10 +32,22 @@ void FileHelper::remove(const char* s)
std::string FileHelper::gettempname()
{
#if defined(TARGET_LINUX) || defined(TARGET_WIN)
char buffer[L_tmpnam];
tmpnam(buffer);
return buffer;
#elif defined(TARGET_OSX)
char template_filename[L_tmpnam] = "rtphone_XXXXXXX.tmp";
int handle = mkstemp(template_filename);
if (handle != -1)
{
close(handle);
return template_filename;
}
else
return std::string();
#endif
}
bool FileHelper::isAbsolute(const std::string& s)