Skip to content
Snippets Groups Projects
Commit f6c86132 authored by arseny.kapoulkine@gmail.com's avatar arseny.kapoulkine@gmail.com
Browse files

tests: Use mkstemp on Unix and QNX (BlackBerry) to avoid tmpnam deprecation warning

git-svn-id: http://pugixml.googlecode.com/svn/trunk@843 99668b35-9821-0410-8761-19e4c4f06640
parent eea13e4d
No related branches found
No related tags found
No related merge requests found
......@@ -382,6 +382,8 @@ TEST_XML(document_save_declaration_latin1, "<node/>")
CHECK(writer.as_narrow() == "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<node />\n");
}
#define USE_MKSTEMP defined(__unix) || defined(__QNX__)
struct temp_file
{
char path[512];
......@@ -389,7 +391,7 @@ struct temp_file
temp_file(): fd(0)
{
#ifdef __unix
#if USE_MKSTEMP
strcpy(path, "/tmp/pugiXXXXXX");
fd = mkstemp(path);
......@@ -407,7 +409,7 @@ struct temp_file
CHECK(unlink(path) == 0);
#endif
#ifdef __unix
#if USE_MKSTEMP
CHECK(close(fd) == 0);
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment