mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Replace use of tmpnam which warns on linux at link time
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
* THE SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "test_common.h"
|
||||
|
||||
std::string GetCWD()
|
||||
@@ -48,4 +49,9 @@ std::string GetEnvVar(const char *var)
|
||||
return data;
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
void tmpnam_via_mkstemp(char (&buf)[MAX_PATH])
|
||||
{
|
||||
snprintf(buf, MAX_PATH - 1, "/tmp/rdoc_tmp/%x", rand());
|
||||
}
|
||||
@@ -33,4 +33,8 @@
|
||||
|
||||
#define msleep(time) usleep((time)*1000)
|
||||
|
||||
#define EXECUTABLE_SUFFIX ""
|
||||
#define EXECUTABLE_SUFFIX ""
|
||||
|
||||
#define get_tmpnam tmpnam_via_mkstemp
|
||||
|
||||
void tmpnam_via_mkstemp(char (&buf)[MAX_PATH]);
|
||||
@@ -300,8 +300,8 @@ std::vector<uint32_t> CompileShaderToSpv(const std::string &source_text, SPIRVTa
|
||||
|
||||
char infile[MAX_PATH] = {};
|
||||
char outfile[MAX_PATH] = {};
|
||||
tmpnam(infile);
|
||||
tmpnam(outfile);
|
||||
get_tmpnam(infile);
|
||||
get_tmpnam(outfile);
|
||||
|
||||
command_line += " -o ";
|
||||
command_line += outfile;
|
||||
|
||||
@@ -44,6 +44,8 @@ std::wstring UTF82Wide(const std::string &s);
|
||||
#define popen _popen
|
||||
#define pclose _pclose
|
||||
|
||||
#define get_tmpnam tmpnam_s
|
||||
|
||||
#define msleep(time) Sleep(time)
|
||||
|
||||
#define WEXITSTATUS(code) code
|
||||
|
||||
Reference in New Issue
Block a user